I have written some code for a module in Access 2000 that carries out a TransferText Action. It opens Word (2000), goes to the specific merge document, merges to a new document then closes the original merge document.
This is the appropriate section of the code:
DoCmd.TransferText acExportMerge, , strQuery, strData
DoCmd.Close acForm, “PrintItems”
Call Shell(“””C:Program FilesMicrosoft OfficeOfficeWinword.exe”” “”C:My DocumentsWinwordBusiness” & strFolderDoc & “.doc”””, vbMaximizedFocus)
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
Windows(strActualDoc).Close (WdSaveOptions.wdDoNotSaveChanges)
It works well.
But the problem is it only works well once – if I use it again for another letter I get this error statement and it only gets as far as the original merge document. (It opens it with the merge info but does not merge to a new doc)
Error No: 462 – Error Description: the remote server machine does not exist or is unavailable.
I am not networked.
I have no idea why it does this – is there a connection still open to Word that shouldn’t be? Can anyone help?
Thanks
Peter Herworth