Export (0) Print
Expand All

Page.Background Property (Visio)

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

Version Added: Visio 2.0

expression .Background

expression A variable that represents a Page object.

Return Value

Integer

The Background property must always be true for markup pages.

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 

Show:
© 2014 Microsoft