Publisher) (Application.ActiveDocument 屬性

會傳回代表使用中出版物的 Document 物件。 如果沒有任何文件開啟,則會發生錯誤。

語法

運算式。ActiveDocument

expression 代表 Application 物件的變數。

傳回值

Document

範例

此範例可讓使用者將檔案名稱指派給使用中的出版物,並以新的檔案名稱儲存。 然後,檔案名稱與其他文字一起插入目前選取的文字之後。 請注意, FileName 必須取代為有效的發行版本名稱,此範例才能運作。

Sub NewsLetterSave() 
 
 Dim strFileName As String 
 
 ' Assign the explicit file name to a variable. 
 strFileName = "FileName" 
 Publisher.ActiveDocument.SaveAs strFileName 
 
 ' Insert the file name and supporting text after selected text. 
 Selection.TextRange.Collapse pbCollapseEnd 
 Selection.TextRange = _ 
 " This publication has been saved as " & strFileName 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。