Table of contents
Collapse the table of content
Expand the table of content

VisWebPageSettings.Stylesheet Property (Visio Save As Web)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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


expression. Stylesheet

_expression_An expression that returns a ** VisWebPageSettings** object.

Return Value



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 (click the BackstageButton tab, click Save As, in the Save as type list, select Web Page (.htm;.html), 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.


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

End Sub
© 2018 Microsoft