Page.Background 属性 (Visio)

确定页面是否为背景页。 读/写。

语法

表达式背景

表达 一个代表 Page 对象的变量。

返回值

整数

备注

Background 属性必须始终可用于标记页。

示例

以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何遍历文档页面并确定页面是前景页还是背景页。 该宏将前景页显示在列表框中。 要运行此宏,请先将一个包含列表框控件的用户窗体插入您的项目中。

 
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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。