我正在尝试通过 VBA 将模板(-.dotm 文件)附加到 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 共享的正确方法是什么?