Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
マクロが格納されたdotmがあります。新しいドキュメントが作成されると、dotmファイルへの参照があります(VBAエディターでプロジェクトを表示している場合)。これを削除する必要があります。
VBAコードでこれを行うことはどういうわけか可能ですか?
プロパティを使用して元の参照を別のテンプレートへの参照に置き換えることにより、元の参照を切断できAttachedtemplateます。例えば:
Attachedtemplate
Private Sub Document_New() ActiveDocument.AttachedTemplate = "C:\Users\Joe\AppData\Roaming\Microsoft\Templates\Normal.dotm" End Sub