VisWebPageSettings.Stylesheet property

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

Syntax

expression.Stylesheet

expression An expression that returns a VisWebPageSettings object.

Return value

String

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 appears in the Style sheet drop-down list on the Advanced tab of the Save As Web Page dialog box (BackstageButton tab > Save As > Save as type list > Web Page (*.htm;*.html) > Publish > 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 webpage that 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 webpage. Also, replace your_Visio_path and your_language_ID with the path to Visio stylesheets on your computer, for example:

C:\Program Files\Microsoft Office\Visio14\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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.