ProtectedViewWindow.Edit 方法 (Word)

語法

運算式。編輯 (PasswordTemplate、 WritePasswordDocument、 WritePasswordTemplate)

運算式 傳回 ProtectedViewWindow 物件的運算式。

參數

名稱 必要/選用 資料類型 描述
PasswordTemplate 選用 Variant 開啟範本的密碼。
WritePasswordDocument 選用 Variant 將變更儲存至文件的密碼。
WritePasswordTemplate 選用 Variant 將變更儲存至範本的密碼。

傳回值

Document

註解

Avoid using hard-coded passwords in your applications. 如果某個程序需要密碼才能執行,請向使用者要求密碼,將它儲存在變數中,然後在程式碼中使用此變數。

範例

下列程式碼範例會開啟 (以編輯與使用中 [受保護的檢視] 視窗相關聯的文件) 。

Dim pvDoc As Document 
 
Set pvDoc = ActiveProtectedViewWindow.Edit

另請參閱

ProtectedViewWindow 物件

支援和意見反應

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