テンプレート (-.dotm ファイル) を VBA 経由で Word 2011 (Mac) ドキュメントに添付しようとしています。テンプレートは、Windows ネットワーク ドライブ ( file://BF-02004/Users/A500579/PublicWordTemplate
) にあります。この共有にはまったく制限がなく、Mac - Finder で閲覧することも問題ありません。
私の問題は、このネットワーク共有をVBA コードから直接アドレス指定するにはどうすればよいですか?
これは、私が何を意味するかを示すために試みたコードの抜粋です。
Option Explicit
'these are options which I have tried
Private Const MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE As String = "smb://BF-02004/Users/A500579/PublicWordTemplate/Core.dotm"
'Private Const MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE As String = "smb:BF-02004:Users:A500579:PublicWordTemplate:Core.dotm"
'Private Const MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE As String = "BF-02004:Users:A500579:PublicWordTemplate:Core.dotm"
'Private Const MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE As String = "BF-02004/Users/A500579/PublicWordTemplate/Core.dotm"
Public Sub LoadTemplate()
'check if file exists (the boolean function FileExists() is defined in another module)
If FileExists(MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE) Then
ActiveDocument.AttachedTemplate = MAC_STYLE_RELATIVE_NETWORK_PATH_TO_TEMPLATE
Else
MsgBox "The template was NOT found!"
Exit Sub
End If
End Sub
Word 2011 - VBA アプリケーション内から Windows 共有に対処する正しい方法は何ですか?