The DocumentProperties Object (SADocumentProperties)
The DocumentProperties object represents properties of a specified
spreadsheet. In Microsoft Excel, these properties are displayed in the Properties
sheet. To view the Properties sheet, open Excel's File menu, and select Properties.
The DocumentProperties object is accessible through the
ExcelApplication object's
DocumentProperties
property:
Set DocumentProperties = ExcelApplication.DocumentProperties
| DocumentProperties Properties |
DocumentProperties Methods |
|
|
General Document Properties Usage
[VBScript]
Dim XlwApp, DocProps, App, CreateDate
'--- Create an instance of ExcelWriter
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
'--- Get a reference to SADocumentProperties
Set DocProps = XlwApp.DocumentProperties
'--- Use DocumentProperties properties
App = DocProps.Application ' returns "SoftArtisans ExcelWriter"
DocProps.Author = "Ms. Jane Doe"
DocProps.Category = "Marketing Category"
DocProps.Comments = "This document contains internal company data."
DocProps.Company = "Product Company, Inc."
CreateDate = DocProps.CreationDate
DocProps.Keywords = "Marketing,Products,Report,Internal"
DocProps.LastSavedBy = "J. Doe"
DocProps.LastSavedDate = "2/24/2004"
DocProps.LinksUpToDate = True
DocProps.Manager = "John Someone"
DocProps.RevisionNumber = "1.1.2"
DocProps.ScaleCrop = False
DocProps.Subject = "Quarterly Marketing Data"
DocProps.Title = "Marketing Report 1Q 2004"
'--- Use the Clear method to clear document properties
DocProps.Clear
| DocumentProperties Properties |
ApplicationSignature
[VBScript]
Property Application As String (read-only)
Description
When ExcelWriter saves a generated spreadsheet, Application is set to
"SoftArtisans ExcelWriter." Application a Read Only property.
Top |
AuthorSignature
[VBScript]
Property Author As String (read/write)
Description
Author sets or returns a spreadsheet's author.
In Microsoft Excel, the value of the Author property is displayed on the
Summary page of the spreadsheet's Properties sheet. To see Excel's Author field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
Excel allows you to search for a file by author:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Author.
- In the Value text box, enter the author.
- Set other search options.
- Click Search.
Author is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Author = "John Smith"
Top |
CategorySignature
[VBScript]
Property Category As String (read/write)
Description
Category sets or returns the value of a spreadsheet's
Category field in Microsoft Excel. To see Excel's Category field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
You can set Category to group files together.
This allows you to search for files according to category:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Category.
- In the Value text box, enter a category.
- Set other search options.
- Click Search.
Category is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Category = "Invoice"
Top |
CommentsSignature
[VBScript]
Property Comments As String (read/write)
Description
Comments sets or returns the value of a spreadsheet's
Comments field in Microsoft Excel. To see Excel Comments field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
In Excel, you can use the Comments field to search for files:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Comments.
- In the Value text box, enter the comments to search for.
- Set other search options.
- Click Search.
Comments is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Comments = "Generated by ExcelWriter"
Top |
CompanySignature
[VBScript]
Property Company As String (read/write)
Description
Company sets or returns the company name displayed
in a spreadsheet's Company field in Microsoft Excel.
To see Excel's Company field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
Excel allows you to search for files by company:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Company.
- In the Value text box, enter a company name to search for.
- Set other search options.
- Click Search.
Company is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Company = "SoftArtisans"
Top |
CreationDateSignature
[VBScript]
Property CreationDate As Variant (read/write)
Description
CreationDate sets or returns the creation date of the specified
spreadsheet. By default, CreationDate returns the
spreadsheet's actual creation date. You can set CreationDate to a
different date, but this will not change the creation date displayed in the
spreadsheet's Properties sheet.
While setting CreationDate will not change the creation date
in the file's Properties sheet, you can use the date you set to search for a file
by creation date:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select CreationDate.
- From the Condition list, select a condition.
- In the Value text box, enter the date to search for.
- Set other search options.
- Click Search.
CreationDate is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.CreationDate = "12/20/2003"
Top |
KeywordsSignature
[VBScript]
Property Keywords As String (read/write)
Description
Keywords sets or returns keywords that can be used
to search for the specified spreadsheet. In Excel, a file's keywords
are displayed in the Summary page of the Properties sheet. To see
the Keywords field in Excel:
- Open Excel's File menu.
- Select Properties.
- Select the Summary tab.
To search for files using a keyword:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Keywords.
- From the Condition list, select a condition.
- In the Value text box, enter a keyword to search for.
- Set other search options.
- Click Search.
Keywords is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Keywords = "ExcelWriter, WordWriter, OfficeWriter"
Top |
LastSavedBySignature
[VBScript]
Property LastSavedBy As String (read/write)
Description
LastSavedBy sets or returns the name of the last person that
saved the current spreadsheet. In Excel, a file's Last saved by field
is displayed in the Statistics page of the file's Properties sheet. To see
the field in Excel:
- Open Excel's File menu.
- Select Properties.
- Select the Statistics tab.
You can use the value of LastSavedBy to search for a files:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Last saved by.
- From the Condition list, select a condition.
- In the Value text box, enter the date to search for.
- Set other search options.
- Click Search.
LastSavedBy is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.LastSavedBy = "Jane"
Top |
LastSavedDateSignature
[VBScript]
Property LastSavedDate As Variant (read/write)
Description
LastSavedDate sets or returns the date on which the current
spreadsheet was last saved. LastSavedDate is not set by default,
is not displayed in the spreadsheet's Properties sheet, and cannot be used
to search for a file.
LastSavedDate is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.LastSavedDate = "12/20/2003"
Top |
LinksUpToDateSignature
[VBScript]
Property LinksUpToDate As Boolean (read/write)
Description
The value of LinksUpToDate specifies whether or not the hyperlinks
in the spreadsheet are up-to-date. Set LinksUpToDate to true
to indicate that the links are up-to-date, and set the property to false
to indicate that the links are not up-to-date. LinksUpToDate is set to
false by default.
LinksUpToDate is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.LinksUpToDate = true
Top |
ManagerSignature
[VBScript]
Property Manager As String (read/write)
Description
Manager sets or returns the value of a spreadsheet's Manager
field in Microsoft Excel. To see Excel's Manager field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
Excel allows you to search for a files by manager:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Manager.
- In the Value text box, enter the manager name to search for.
- Set other search options.
- Click Search.
Manager is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Manager = "John Smith"
Top |
RevisionNumber
Signature
[VBScript]
Property RevisionNumber As String (read/write)
in the Statistics page of the spreadsheet's Properties sheet.
To see Excel's Revision number field:
- In Excel, open the File menu.
- Select Properties.
- Select the Statistics tab.
Excel allows you to search for a files by revision number:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Revision.
- In the Value text box, enter a revision number.
- Set other search options.
- Click Search.
RevisionNumber is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.RevisionNumber = "7"
Top |
ScaleCropSignature
[VBScript]
Property ScaleCrop As Boolean (read/write)
Description
ScaleCrop sets or returns a value that indicates whether
scaling or cropping is desired. Set ScaleCrop to true
when scaling of the thumbnail is desired. Set ScaleCrop to
false when cropping is desired.
ScaleCrop is a Read/Write property and is set to
true by default.
Top |
SubjectSignature
[VBScript]
Property Subject As String (read/write)
Description
Subject sets or returns the value of a spreadsheet's
Subject field in Microsoft Excel. To see Excel's Subject field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
You can set Subject to group files together.
This allows you to search for files according to subject:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Subject.
- In the Value text box, enter a subject.
- Set other search options.
- Click Search.
Subject is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Subject = "Web reporting solutions"
Top |
TitleSignature
[VBScript]
Property Title As String (read/write)
Description
Title sets or returns the value of a spreadsheet's
Title field in Microsoft Excel. To see Excel's Title field:
- In Excel, open the File menu.
- Select Properties.
- Select the Summary tab.
Excel allows you to search for a files by title:
- In Excel, click the Search button.

- Click Advanced Search.
- From the Property drop-down list, select Title.
- In the Value text box, enter a title.
- Set other search options.
- Click Search.
Title is a Read/Write property.
Example
Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Title = "SoftArtisans OfficeWriter"
Top |
| DocumentProperties Methods |
ClearSignature
Description
Clear clears most of the fields in the current spreadsheet's
Properties sheet. To see a file's Properties sheet:
- In Excel, open the File menu.
- Select Properties.
Example
Top |

Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.
|