|
Prev: copying styles
Next: textColumns
From: Database Whiz Consulting Database Whiz on 6 Jul 2008 17:43 We have an application that creates protected 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 with Word 2000, nor does it occur with documents not created in this manner. 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 wrdApp.Documents.Item(1).Activate 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
From: Doug Robbins - Word MVP on 6 Jul 2008 19:51 Does the user have the checkboxes for "Update automatic links at Open" and/or "Update fields" and "Update links" checked on the General and Print tabs of the Options dialog (accessed by selecting Options from the Tools menu in Word 2003) and under the Advanced and Display sections of the Word Options dialog in 2007? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Database Whiz Consulting" <Database Whiz Consulting(a)discussions.microsoft.com> wrote in message news:04D8BE3E-EE34-4DFE-8268-0179526FFA1C(a)microsoft.com... > We have an application that creates protected 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 with Word 2000, nor does it > occur > with documents not created in this manner. 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 > wrdApp.Documents.Item(1).Activate > 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
From: Database Whiz Consulting on 6 Jul 2008 23:16 The Update Links and Update Fields boxes were not checked. Update automatic links at Open was checked so I unchecked it. It did not affect behavior. I really appreciate the response. Got any other clues? TIA Ray Jefferson Database Whiz Consulting "Doug Robbins - Word MVP" wrote: > Does the user have the checkboxes for "Update automatic links at Open" > and/or "Update fields" and "Update links" checked on the General and Print > tabs of the Options dialog (accessed by selecting Options from the Tools > menu in Word 2003) and under the Advanced and Display sections of the Word > Options dialog in 2007? > > -- > Hope this helps. > > Please reply to the newsgroup unless you wish to avail yourself of my > services on a paid consulting basis. > > Doug Robbins - Word MVP > > "Database Whiz Consulting" <Database Whiz > Consulting(a)discussions.microsoft.com> wrote in message > news:04D8BE3E-EE34-4DFE-8268-0179526FFA1C(a)microsoft.com... > > We have an application that creates protected 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 with Word 2000, nor does it > > occur > > with documents not created in this manner. 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 > > wrdApp.Documents.Item(1).Activate > > 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 > > >
From: Doug Robbins - Word MVP on 6 Jul 2008 23:26 If the document was printed to a printer/printer driver combination that differed from that which was active on the computer on which the document was created, the document may have been repaginated which would be enough to trigger the Save prompt. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Database Whiz Consulting" <DatabaseWhizConsulting(a)discussions.microsoft.com> wrote in message news:F4D0FF1F-5735-4EED-AB6B-F5634BA43A8D(a)microsoft.com... > The Update Links and Update Fields boxes were not checked. Update > automatic > links at Open was checked so I unchecked it. It did not affect behavior. > > I really appreciate the response. Got any other clues? > > TIA > > Ray Jefferson > Database Whiz Consulting > > "Doug Robbins - Word MVP" wrote: > >> Does the user have the checkboxes for "Update automatic links at Open" >> and/or "Update fields" and "Update links" checked on the General and >> tabs of the Options dialog (accessed by selecting Options from the Tools >> menu in Word 2003) and under the Advanced and Display sections of the >> Word >> Options dialog in 2007? >> >> -- >> Hope this helps. >> >> Please reply to the newsgroup unless you wish to avail yourself of my >> services on a paid consulting basis. >> >> Doug Robbins - Word MVP >> >> "Database Whiz Consulting" <Database Whiz >> Consulting(a)discussions.microsoft.com> wrote in message >> news:04D8BE3E-EE34-4DFE-8268-0179526FFA1C(a)microsoft.com... >> > We have an application that creates protected 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 with Word 2000, nor does it >> > occur >> > with documents not created in this manner. 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 >> > wrdApp.Documents.Item(1).Activate >> > 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 >> >> >>
From: Database Whiz Consulting on 7 Jul 2008 00:53
Thanks Doug, but yeah, that's not it either. At first I thought you might be on to something cuz I thought it might be because the Mail Merge doc was created with one machine and its printer, while the actual mail merged document would be created on the client. However, I did a couple of things to disprove this. 1) I opened and resaved the Mail Merge doc and then ran the client app all from the same machine. Same behavior. 2) I simply opened the merged doc, printed it, and when I got the prompt, I chose YES and saved the document. I then reopened the doc and printed it again. It still prompts me to save the document. It also appears that I misspoke earlier. The behavior does occur with Word 2000. Not sure why I thought it didn't. I also just tried this. I commented out the line that protects the document. I created a file, opened it, modified it, and saved it. Then I printed it. Sure enough, it prompted me to save the document anyway. In all scenarios, we'll only get the prompt if we print the document. Simply opening the doc will not cause the prompt when you close the document. I won't keep bugging you, but if you come up with anything else for me to try, please let me know. Thanks Doug, Ray Jefferson Database Whiz Consulting "Doug Robbins - Word MVP" wrote: > If the document was printed to a printer/printer driver combination that > differed from that which was active on the computer on which the document > was created, the document may have been repaginated which would be enough to > trigger the Save prompt. > > -- > Hope this helps. > > Please reply to the newsgroup unless you wish to avail yourself of my > services on a paid consulting basis. > > Doug Robbins - Word MVP > > "Database Whiz Consulting" > <DatabaseWhizConsulting(a)discussions.microsoft.com> wrote in message > news:F4D0FF1F-5735-4EED-AB6B-F5634BA43A8D(a)microsoft.com... > > The Update Links and Update Fields boxes were not checked. Update > > automatic > > links at Open was checked so I unchecked it. It did not affect behavior. > > > > I really appreciate the response. Got any other clues? > > > > TIA > > > > Ray Jefferson > > Database Whiz Consulting > > > > "Doug Robbins - Word MVP" wrote: > > > >> Does the user have the checkboxes for "Update automatic links at Open" > >> and/or "Update fields" and "Update links" checked on the General and > >> tabs of the Options dialog (accessed by selecting Options from the Tools > >> menu in Word 2003) and under the Advanced and Display sections of the > >> Word > >> Options dialog in 2007? > >> > >> -- > >> Hope this helps. > >> > >> Please reply to the newsgroup unless you wish to avail yourself of my > >> services on a paid consulting basis. > >> > >> Doug Robbins - Word MVP > >> > >> "Database Whiz Consulting" <Database Whiz > >> Consulting(a)discussions.microsoft.com> wrote in message > >> news:04D8BE3E-EE34-4DFE-8268-0179526FFA1C(a)microsoft.com... > >> > We have an application that creates protected 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 with Word 2000, nor does it > >> > occur > >> > with documents not created in this manner. 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 > >> > wrdApp.Documents.Item(1).Activate > >> > 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 > >> > >> > >> > > > |