I am trying to print a word document from Access. The code I've
written works well in my computer but does not in the one were it is
needed.
Here the piece of code:
'doc path
strObjectPath = "P:\2004workshe ets\IIS_WS.doc"
Set oWord = New Word.Applicatio n
oWord.Documents .Add (strObjectPath)
oWord.PrintOut
oWord.Quit SaveChanges:=0
Set oWord = Nothing
In my computer the document prints correctly and the fields in word
that are linked to a tmpTable in Access are correctly refreshed.
In the other computer the document prints without refreshing.
I tried several thingd such as:
Set oWord = New Word.Applicatio n
oWord.Documents .Add (strObjectPath)
'added this line to update fields in the word doc
oWord.ActiveDoc ument.Fields.Up date
oWord.PrintOut
oWord.Quit SaveChanges:=0
Another problem is that in the other computer the print Icon appeared
but the document was not printing, I resolved the problem by adding a
message box between PrintOut and Quit line and this has resolved the
printing problem but not the refreshing of the linked fields.
If any one has any idea regarding what's going on I will really
appreciate it.
Thanks,
Stefania
Set oWord = Nothing
written works well in my computer but does not in the one were it is
needed.
Here the piece of code:
'doc path
strObjectPath = "P:\2004workshe ets\IIS_WS.doc"
Set oWord = New Word.Applicatio n
oWord.Documents .Add (strObjectPath)
oWord.PrintOut
oWord.Quit SaveChanges:=0
Set oWord = Nothing
In my computer the document prints correctly and the fields in word
that are linked to a tmpTable in Access are correctly refreshed.
In the other computer the document prints without refreshing.
I tried several thingd such as:
Set oWord = New Word.Applicatio n
oWord.Documents .Add (strObjectPath)
'added this line to update fields in the word doc
oWord.ActiveDoc ument.Fields.Up date
oWord.PrintOut
oWord.Quit SaveChanges:=0
Another problem is that in the other computer the print Icon appeared
but the document was not printing, I resolved the problem by adding a
message box between PrintOut and Quit line and this has resolved the
printing problem but not the refreshing of the linked fields.
If any one has any idea regarding what's going on I will really
appreciate it.
Thanks,
Stefania
Set oWord = Nothing
Comment