unioffice/example_test.go

25 lines
638 B
Go
Raw Permalink Normal View History

package gooxml_test
2017-09-07 07:39:56 -04:00
import (
"baliance.com/gooxml/document"
"baliance.com/gooxml/spreadsheet"
)
func Example_document() {
// see the baliance.com/gooxml/document documentation or _examples/document
// for more examples
doc := document.New()
doc.AddParagraph().AddRun().AddText("Hello World!")
doc.SaveToFile("document.docx")
}
2017-09-07 07:39:56 -04:00
func Example_spreadsheeet() {
// see the baliance.com/gooxml/spreadsheet documentation or _examples/spreadsheet
// for more examples
ss := spreadsheet.New()
sheet := ss.AddSheet()
sheet.AddRow().AddCell().SetString("Hello")
sheet.Cell("B1").SetString("World!")
ss.SaveToFile("workbook.xlsx")
}