Table of contents
TOC
折叠目录
展开目录

Wizard 对象 (发布服务器)Wizard Object (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
3 参与人员

代表与出版物相关的出版物设计方案或与“设计方案库”对象相关的向导。Represents the publication design associated with a publication or the wizard associated with a Design Gallery object.

示例Example

使用文档页面形状ShapeRange对象的向导属性返回向导对象。以下示例报告与当前出版物,显示它的名称和当前设置关联的出版物设计方案。Use the Wizard property of a Document, Page, Shape or ShapeRange object to return a Wizard object. The following example reports on the publication design associated with the active publication, displaying its name and current settings.

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

请注意 根据 Microsoft 发布服务器所使用的语言版本,您可能会使用上面的代码时收到错误。如果发生这种情况,您需要安装错误处理程序以防止错误。下面的示例的作用与上述代码相同,但具有内置的这种情况发生的错误处理程序。Note Depending on the language version of Microsoft Publisher that you are using, you may receive an error when using the above code. If this occurs, you will need to build in error handlers to circumvent the errors. The following example functions as the code above but has error handlers built in for this situation.

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

方法Methods

名称Name
SetIdSetId

属性Properties

名称Name
ApplicationApplication
IDID
NameName
ParentParent
PropertiesProperties
© 2018 Microsoft