Stylesheet Property [Visio 2003 SDK Documentation]

Specifies a cascading stylesheet (CSS) provided by Microsoft Office Visio, or one that you have created, that is applied to the Web page. Returns String. Read/write String.

retString = object.Stylesheet

object.Stylesheet = stringVal

retStringString. The current Web page stylesheet.

object Required. An expression that returns a VisWebPageSettings object.

stringVal Required String. The new Web page stylesheet.

Remarks

A stylesheet can be one provided by Visio or one that you create yourself. If you store a stylesheet that you create in the following folder, it will appear in the Style sheet drop-down list on the Advanced tab of the Save As Web Page dialog box (on the File menu, click Save As Web Page, click Publish, and then click Advanced):

\your_Visio_path\your_language_ID\

Visio identifies stylesheets by searching through the folder named for your language ID (for example, 1033) for CSS files.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the Stylesheet property to assign the "Steel" stylesheet (supplied by Visio) to the Web page you are creating.

Before running this macro, replace path\filename.htm with a valid target path on your computer and the file name that you want to assign to your Web page. Also, replace your_Visio_path and your_language_ID with the path to Microsoft Office Visio stylesheets on your computer, for example:

C:\Program Files\Microsoft Office\Visio11\1033...

Public Sub Stylesheet_Example()
    Dim vsoSaveAsWeb As VisSaveAsWeb 
    Dim vsoWebSettings As VisWebPageSettings

    Set vsoSaveAsWeb = Visio.Application.SaveAsWebObject 
    Set vsoWebSettings = vsoSaveAsWeb.WebPageSettings

    With vsoWebSettings
        .Stylesheet = "your_Visio_path\your_language_ID\Steel.css"
        .TargetPath = "path\filename.htm" 
    End With

    vsoSaveAsWeb.CreatePages 
End Sub

Applies to | VisWebPageSettings Object