Background Property [Visio 2003 SDK Documentation]

Determines whether a page is a background page.

retVal = object**.Background**

object**.Background** = intExpression

retVal     Integer. True if the page is a background page; otherwise, False.

object     Required. An expression that returns a Page object.

intExpression     Required Integer. False (0) to declare the page as a foreground page; True (non-zero) to declare it as a background page.

Version added

2.0

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

Applies to | Page object

See Also | BackPage property