VisWebPageSettings.TargetPath 屬性
指定放置網頁及其支援檔案的路徑。 讀取/寫入。
語法
運算式。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 支援與意見反應。