Publisher) (向导对象

表示与发布关联的发布设计,或与设计库对象关联的向导。

备注

使用 Document、Page、Shape 或 ShapeRange 对象的向导属性返回向导对象。

示例

注意

使用此代码时可能会收到错误,具体取决于所使用的 Publisher 的语言版本。 如果出现这种情况,您必须内置错误处理程序以防止错误发生。

此示例报告与活动发布关联的发布设计,显示其名称和当前设置。

Dim wizTemp As Wizard 
Dim wizproTemp As WizardProperty 
Dim wizproAll As WizardProperties 
 
Set wizTemp = ActiveDocument.Wizard 
 
With wizTemp 
 Set wizproAll = .Properties 
 MsgBox "Publication Design associated with " _ 
 & "current publication: " _ 
 & .Name 
 For Each wizproTemp In wizproAll 
 With wizproTemp 
 MsgBox " Wizard property: " _ 
 & .Name & " = " & .CurrentValueId 
 End With 
 Next wizproTemp 
End With

以下示例的功能与前面的代码相同,但内置了用于此情形的错误处理程序。

Sub ExampleWithErrorHandlers() 
 Dim wizTemp As Wizard 
 Dim wizproTemp As WizardProperty 
 Dim wizproAll As WizardProperties 
 
 Set wizTemp = ActiveDocument.Wizard 
 
 With wizTemp 
 Set wizproAll = .Properties 
 Debug.Print "Publication Design associated with " _ 
 & "current publication: " _ 
 & .Name 
 For Each wizproTemp In wizproAll 
 With wizproTemp 
 If wizproTemp.Name = "Layout" Or wizproTemp _ 
 .Name = "Layout (Intl)" Then 
 On Error GoTo Handler 
 MsgBox " Wizard property: " _ 
 & .Name & " = " & .CurrentValueId 
 
Handler: 
 If Err.Number = 70 Then Resume Next 
 Else 
 MsgBox " Wizard property: " _ 
 & .Name & " = " & .CurrentValueId 
 End If 
 End With 
 Next wizproTemp 
 End With 
End Sub

方法

属性

另请参阅

支持和反馈

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