-
Notifications
You must be signed in to change notification settings - Fork 4
/
doc_properties.bas
44 lines (35 loc) · 1.42 KB
/
doc_properties.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/'
* Example of setting document properties such as Author, Title, etc., for an
* Excel spreadsheet using libxlsxwriter.
*
* Copyright 2014-2017, John McNamara, [email protected]
*
* translated by Lee June by using https://github.com/retsyo/libxlsxwriter_freebasic
'/
#include "auto_xlsxwriter.bi"
function main() as Integer
Dim as lxw_workbook ptr workbook = workbook_new("doc_properties.xlsx")
Dim as lxw_worksheet ptr worksheet = workbook_add_worksheet(workbook, NULL)
/' Create a properties structure and set some of the fields. '/
Dim as lxw_doc_properties properties
With properties
.title = @"This is an example spreadsheet"
.subject = @"With document properties"
.author = @"John McNamara"
.manager = @"Dr. Heinz Doofenshmirtz"
.company = @"of Wolves"
.category = @"Example spreadsheets"
.keywords = @"Sample, Example, Properties"
.comments = @"Created with libxlsxwriter"
.status = @"Quo"
End With
/' Set the properties in the workbook. '/
workbook_set_properties(workbook, @properties)
/' Add some text to the file. '/
worksheet_set_column(worksheet, 0, 0, 50, NULL)
worksheet_write_string(worksheet, 0, 0, _
"Select 'Workbook Properties' to see properties." , NULL)
workbook_close(workbook)
return 0
End Function
main()