指定網頁及其支援檔案的放置路徑。 讀取/寫入。
語法
運算式。TargetPath
運算式 傳回 VisWebPageSettings 物件的運算式。
傳回值
字串
註解
當您將圖面儲存為網頁時,必須使用 TargetPath 性質來提供完整的目標路徑。 每次匯出之後, TargetPath 屬性都會重設為 null 值;每次將圖面儲存為網頁時,都必須明確提供目標路徑。 此外, TargetPath 值不會在 Visio 工作階段之間保留。
TargetPath 屬性的值會對應至 [另存新檔] 對話方塊 ([BackstageButton] 索引標籤>、[另存新檔]) 中選取的資料夾名稱和檔案名稱。
範例
下列巨集顯示如何將使用中的檔案儲存為網頁,並將產生的 HTML 檔案和支援檔案作為一般檔案放置在 targetpath 資料夾中。 由於 StoreInFolder 屬性設定為 False,因此支援檔案會放置在與根 HTML 檔案相同的資料夾中,而不是名稱為 filename_files 或 filename.files 的個別資料夾中,視語言而定。
Public Sub TargetPath_Example()
Dim vsoSaveAsWeb As VisSaveAsWeb
Dim vsowebSettings As VisWebPageSettings
Set vsoSaveAsWeb = Visio.Application.SaveAsWebObject
Set vsoWebSettings = vsoSaveAsWeb.WebPageSettings
With vsoWebSettings
.StoreInFolder = False
.TargetPath = "<variable>targetpath\filename.htm</variable>"
End With
vsoSaveAsWeb.CreatePages
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。