Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.7.1
ASP/COM Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication >
Objects > DocumentProperties

ExcelApplication is not
available in ExcelWriterSE.

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

Application

Signature


[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

Author

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

Excel allows you to search for a file by author:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Author.
  4. In the Value text box, enter the author.
  5. Set other search options.
  6. Click Search.

Author is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Author = "John Smith"

Top

Category

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

You can set Category to group files together. This allows you to search for files according to category:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Category.
  4. In the Value text box, enter a category.
  5. Set other search options.
  6. Click Search.

Category is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Category = "Invoice"

Top

Comments

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

In Excel, you can use the Comments field to search for files:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Comments.
  4. In the Value text box, enter the comments to search for.
  5. Set other search options.
  6. Click Search.

Comments is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Comments = "Generated by ExcelWriter"

Top

Company

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

Excel allows you to search for files by company:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Company.
  4. In the Value text box, enter a company name to search for.
  5. Set other search options.
  6. Click Search.

Company is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Company = "SoftArtisans"

Top

CreationDate

Signature


[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:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select CreationDate.
  4. From the Condition list, select a condition.
  5. In the Value text box, enter the date to search for.
  6. Set other search options.
  7. Click Search.

CreationDate is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.CreationDate = "12/20/2003"

Top

Keywords

Signature


[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:

  1. Open Excel's File menu.
  2. Select Properties.
  3. Select the Summary tab.

To search for files using a keyword:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Keywords.
  4. From the Condition list, select a condition.
  5. In the Value text box, enter a keyword to search for.
  6. Set other search options.
  7. Click Search.

Keywords is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Keywords = "ExcelWriter, WordWriter, OfficeWriter"

Top

LastSavedBy

Signature


[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:

  1. Open Excel's File menu.
  2. Select Properties.
  3. Select the Statistics tab.

You can use the value of LastSavedBy to search for a files:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Last saved by.
  4. From the Condition list, select a condition.
  5. In the Value text box, enter the date to search for.
  6. Set other search options.
  7. Click Search.

LastSavedBy is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.LastSavedBy = "Jane"

Top

LastSavedDate

Signature


[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

LinksUpToDate

Signature


[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

Manager

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

Excel allows you to search for a files by manager:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Manager.
  4. In the Value text box, enter the manager name to search for.
  5. Set other search options.
  6. 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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Statistics tab.

Excel allows you to search for a files by revision number:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Revision.
  4. In the Value text box, enter a revision number.
  5. Set other search options.
  6. Click Search.

RevisionNumber is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.RevisionNumber = "7"

Top

ScaleCrop

Signature


[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

Subject

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

You can set Subject to group files together. This allows you to search for files according to subject:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Subject.
  4. In the Value text box, enter a subject.
  5. Set other search options.
  6. Click Search.

Subject is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Subject = "Web reporting solutions"

Top

Title

Signature


[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:

  1. In Excel, open the File menu.
  2. Select Properties.
  3. Select the Summary tab.

Excel allows you to search for a files by title:

  1. In Excel, click the Search button.



  2. Click Advanced Search.
  3. From the Property drop-down list, select Title.
  4. In the Value text box, enter a title.
  5. Set other search options.
  6. Click Search.

Title is a Read/Write property.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Title = "SoftArtisans OfficeWriter"

Top



DocumentProperties Methods

Clear

Signature


[VBScript]
Sub Clear()

Description

Clear clears most of the fields in the current spreadsheet's Properties sheet. To see a file's Properties sheet:

  1. In Excel, open the File menu.
  2. Select Properties.

Example

Set DocProperties = ExcelApplication.DocumentProperties
DocProperties.Clear

Top





Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.