Publisher (的 Wizard 物件)
表示與發行集相關聯的發行集設計,或與設計庫物件相關聯的精靈。
註解
使用Document、Page、Shape或ShapeRange物件的 Wizard屬性可傳回Wizard物件。
範例
注意事項
根據您使用的發行者語言版本,您可能會在使用此程式碼時收到錯誤。 如果發生這種情形,則需要建立錯誤處理程式來防止錯誤。
此範例會報告與使用中出版物相關聯的發行集設計,並顯示其名稱和目前的設定。
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 支援與意見反應。