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

Page.Background Property (Visio)

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

Determines whether a page is a background page. Read/write.

Syntax

expression . Background

expression A variable that represents a Page object.

Return Value

Integer

Remarks

The Background property must always be true for markup pages.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to iterate through a document's pages and determine whether a page is a foreground or background page. It displays the foreground pages in a list box. To run this macro, first insert a user form containing a list box control into your project.


Public Sub Background_Example() 

 Dim vsoPages As Visio.Pages 
 Dim vsoPage As Visio.Page 
 Dim intCounter As Integer 

 'Get the Pages collection. 
 Set vsoPages = ThisDocument.Pages 

 'Make sure the list box is cleared. 
 UserForm1.ListBox1.Clear 

 'Iterate through the collection. 
 For intCounter = 1 To vsoPages.Count 

 'Retrieve the Page object at the current index. 
 Set vsoPage = vsoPages(intCounter) 

 'Check whether the current page is a background page. 
 'Display the names of all the foreground pages. 
 If vsoPage.Background = False Then 

 UserForm1.ListBox1.AddItem vsoPage.Name 

 End If 

 Next intCounter 

 'Display the user form. 
 UserForm1.Show 

End Sub
© 2017 Microsoft