I'm running code in Access that is supposed to open a document in Word for a mail merge. The problem is, I get an error saying the path is not valid. Upon testing and researching this, I have discovered the problem is the spaces--it only reads this much of the path correctly: "\\documents\Offices\Judicial"
Someone suggested "MapPath"--but I am unfamiliar with that because I am only a beginner with VBA. (I'm good at copying and pasting what other people suggest though!
) Could someone look at the following code and give me ideas that might work?
Dim myQuery As String
Dim myPath As String
myPath = myPath = "\\documents\Offices\Judicial & Court Services\Judicial College\Shared Project Folders\Templates\Letters & Accessories\MailMergeTemplates\Conf Letter Mail Merge.doc"
myQuery = "qryMakeTempTable"
DoCmd.SetWarnings (WarningsOff)
DoCmd.OpenQuery (myQuery)
Dim MyDoc
MyDoc = Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE " & myPath, 1)
DoCmd.SetWarnings (WarningsOn)
DoCmd.Quit acSave
DoCmd.Close , ""
End Sub
Someone suggested "MapPath"--but I am unfamiliar with that because I am only a beginner with VBA. (I'm good at copying and pasting what other people suggest though!

Dim myQuery As String
Dim myPath As String
myPath = myPath = "\\documents\Offices\Judicial & Court Services\Judicial College\Shared Project Folders\Templates\Letters & Accessories\MailMergeTemplates\Conf Letter Mail Merge.doc"
myQuery = "qryMakeTempTable"
DoCmd.SetWarnings (WarningsOff)
DoCmd.OpenQuery (myQuery)
Dim MyDoc
MyDoc = Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE " & myPath, 1)
DoCmd.SetWarnings (WarningsOn)
DoCmd.Quit acSave
DoCmd.Close , ""
End Sub