Example: Setting Document Properties — XlsxWriter Documentation

### Navigation

- index
- next |
- previous |
- XlsxWriter Documentation »
- Examples »

# Example: Setting Document Properties

This program is an example setting document properties. See the `set_properties()` workbook method for more details.

    ##############################################################################
    #
    # An example of adding document properties to a XlsxWriter file.
    #
    # Copyright 2013, John McNamara, jmcnamara@cpan.org
    #
    from xlsxwriter.workbook import Workbook

    workbook = Workbook('doc_properties.xlsx')
    worksheet = workbook.add_worksheet()

    workbook.set_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 Python and XlsxWriter',
        'status':   'Quo',
    })

    worksheet.set_column('A:A', 70)
    worksheet.write('A1', "Select 'Workbook Properties' to see properties.")

### Navigation

- index
- next |
- previous |
- XlsxWriter Documentation »
- Examples »