共用方式為


Wizard 物件 (出版商)

代表與出版品相關的出版設計,或與設計畫廊物件相關的精靈。

註解

使用文件頁面形狀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 支援與意見反應