I am trying to attach a template (-.dotm file) to a Word 2011 (Mac) document via VBA. The template is located on a windows network drive (file://BF-02004/Users/A500579/PublicWordTemplate
). There are absolutely no restrictions on this share, there is no problem browsing it with Mac - Finder either.
My problem is, how should I address this network share directly from my VBA code?
Here is an code excerpt on what I have tried to show what I mean:
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
What is the correct way to address a windows share from inside a Word 2011 - VBA application?