サブメイン()
'メインファイルがアセンブリドキュメントであるかどうかを確認します
このapplication.activedocumenttype = documenttypeenum.kassemblydocumentobject の場合
' 応答 "yes" はファイルから読み取り専用の属性を設定します
' 応答 "no" はファイルから読み取り専用の属性を削除します。
myparam = messagebox.show(" は読み取り専用、読み込み/書き込みなし、"readonly", messageboxbuttons.yesnocancel" のみです。
もしmyparam < > vbcancel その後
readonlyfiles(myparam = vbyes, true, false) を呼び出します。
端 もし
端 もし
メニュー
パブリックサブ readonlyfiles(setreadonly as boolean)
文字列 = thisapplication.activedocument.fullfilename として adoc を dim
ディムは発明者として置きました。 selectset = thisapplication.activedocument.selectset
subdocname を文字列として定義する
' サイクルは、制御の最初のレベルに意図的に停止します
' 選択したコンポーネントが set/part で、属性を変更するかどうかを確認します。
' 選択した軸と最初のレベルのコンポーネント(すべてのタイプのドキュメント)
sset の各 cocc のため
お問い合わせ cocc.definitiondocumenttype = documenttypeenum.kassemblydocumentobject それから
お問い合わせ cocc.referencedfiledescriptor.fullfilename <> adoc その後
' 選択した axieme の read-only 属性を変更する
setroattribute 呼び出し (cocc.referencedfiledescriptor.fullfilename, setreadonly)
各osuboccはcocc.definition.document.allreferenceddocumentsで
' 最初のレベルの文書の読み取り専用属性を変更する
コール setroattribute(osubocc.fullfilename、setreadonly)
次へ
端 もし
その他 cocc.definitiondocumenttype = documenttypeenum.kpartdocumentobject それから
' ドキュメント型部分の読み込み専用属性を変更する
setroattribute 呼び出し (cocc.referencedfiledescriptor.fullfilename, setreadonly)
端 もし
次へ
メニュー
パブリックサブ setroattribute(文字列としてパス, boolean として roattribute)
システム.io.fileinfo として finfo を dim に
system.io.file.exists(path) の場合、
finfo = new system.io.fileinfo(パス)
finfo.isreadonly = ロアトリビュート
端 もし
メニュー