代表與出版物相關聯的出版物設計,或與 [設計庫] 物件相關聯的精靈。
註解
使用 Document、Page、Shape 或 ShapeRange 物件的 Wizard 屬性來傳回 Wizard 物件。
範例
注意事項
依據您使用的 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 支援與意見反應。