D
Database Whiz Consulting
Hello All. I posted this question last week. Got some suggestions from Doug
the MVP (Gracias for you efforts), but was unable to solve the problem. No
one else chimed in. Here's the deal.
We have an application that creates Word documents by automating
Word with VBA and mail merge. All is good, application works as it should,
creates the documents just fine and all. Problem is, when the user opens the
file with Word 2003 or 2007 and prints the document (they are protected, so
they can't change them), the document still prompts the user if they want to
save the document. Behaviour does not occur if the file is created with Word
2000 or Word XP, nor does it occur with documents not created in this manner.
Behavior continues with file indefinitely, where it will always prompt the
user to save the document upon close if the user prints the document. I've
posted an example of the document on our website:
http://www.databasewhiz.com/tmp/NAS/8000009_Demand Letter.doc
Clearly Word thinks something is changing when the user prints the file, but
what? I've included part of the Sub that generates the file:
Set wrdApp = CreateObject("Word.Application")
wrdApp.Documents.Open FileName:=strDoc, AddToRecentFiles:=False,
Visible:=True
With wrdApp.Documents(strDoc).MailMerge
.DataSource.FirstRecord = 1
.DataSource.LastRecord = 1
.Destination = wdSendToNewDocument
.Execute
End With
wrdApp.Documents.Item(1).Activate
wrdApp.Documents.Item(1).Protect wdAllowOnlyComments
wrdApp.Documents.Item(1).SaveAs "C:\access\NAS\" & intHmnrID & "_" &
strDocName
wrdApp.Documents.Item(1).Close
wrdApp.Documents(strDoc).Close SaveChanges:=wdDoNotSaveChanges
wrdApp.Quit
Set wrdApp = Nothing
Nightmare prompt is starting to cost us lots of time & money. If anybody has
a clue as to why this would occur and how to fix it, would really really
appreciate it.
Thanks In Advance,
RJ
Database Whiz Consulting
the MVP (Gracias for you efforts), but was unable to solve the problem. No
one else chimed in. Here's the deal.
We have an application that creates Word documents by automating
Word with VBA and mail merge. All is good, application works as it should,
creates the documents just fine and all. Problem is, when the user opens the
file with Word 2003 or 2007 and prints the document (they are protected, so
they can't change them), the document still prompts the user if they want to
save the document. Behaviour does not occur if the file is created with Word
2000 or Word XP, nor does it occur with documents not created in this manner.
Behavior continues with file indefinitely, where it will always prompt the
user to save the document upon close if the user prints the document. I've
posted an example of the document on our website:
http://www.databasewhiz.com/tmp/NAS/8000009_Demand Letter.doc
Clearly Word thinks something is changing when the user prints the file, but
what? I've included part of the Sub that generates the file:
Set wrdApp = CreateObject("Word.Application")
wrdApp.Documents.Open FileName:=strDoc, AddToRecentFiles:=False,
Visible:=True
With wrdApp.Documents(strDoc).MailMerge
.DataSource.FirstRecord = 1
.DataSource.LastRecord = 1
.Destination = wdSendToNewDocument
.Execute
End With
wrdApp.Documents.Item(1).Activate
wrdApp.Documents.Item(1).Protect wdAllowOnlyComments
wrdApp.Documents.Item(1).SaveAs "C:\access\NAS\" & intHmnrID & "_" &
strDocName
wrdApp.Documents.Item(1).Close
wrdApp.Documents(strDoc).Close SaveChanges:=wdDoNotSaveChanges
wrdApp.Quit
Set wrdApp = Nothing
Nightmare prompt is starting to cost us lots of time & money. If anybody has
a clue as to why this would occur and how to fix it, would really really
appreciate it.
Thanks In Advance,
RJ
Database Whiz Consulting