I have a odd problem, to which I've developed a work around. However, I'm still curious as to why the error occurred in the first place. I'm working on an application that is used to produce access reports and open word documents, some of which are merge documents. All the documents as well as the front-end reside on a network share. Yes I know that each user should have their own copy of the front-end on their machine, however this is how the client wants it.
When I use the following code to open up a merged document, the word document opens up fine and the merge is executed. However, when I try to open up a regular non-merge word document, I get an error message that the file is not found. However, the message specifies a location on the "C:\Users\chtullu134\old.d
oc" has not been found. I've stepped through the code and find that I am passing the correct code. I'm not sure what is going on.
Dim stAppName As String
stAppName = "Winword.exe " & strDocPath
Call Shell(stAppName, 1)
However, when using the following code to open a non-merge document, the document opens up fine. The only problem is that while merged documents are opened up, the merge is not performed.
'Code for non merge documente
Dim intStrLength As Integer
Dim strDocName As String
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
Dim objPrinter As Printer
Set objPrinter = Application.Printer
.Activeprinter = objPrinter.DeviceName
.Visible = True
Set objWord = Nothing