Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2006

Tip: Looking for answers? Try searching our database.

Closing write protected word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hufflehuffle@west.de - 02 Feb 2006 11:46 GMT
Hi!

I am launching a word "serial letter" from access. The new document is
created correctly. When I try to close the template document (which is
write protected) using

objWord.close wdDoNotSaveChanges

I always get asked where to save the document (although I asked not to
save changes).

Can this be avoided?
Thanks for your ideas.
Best regards,
Andreas
John Nurick - 02 Feb 2006 20:25 GMT
Hi Andreas,

1) What is the value of wdDoNotSaveChanges at this point in your code?
It needs to be 0 or False (I find it easier just to pass True or False
in this argument rather than try to remember the names of the Word
constants).

2) If that's not the answer, is it possible that something you've done
has created another document, or modified a template, without your
noticing?

>Hi!
>
[quoted text clipped - 11 lines]
>Best regards,
>Andreas

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
hufflehuffle@west.de - 03 Feb 2006 07:53 GMT
John Nurick schrieb:

> Hi Andreas,

Hi, John,

thanks for your answer.

> 1) What is the value of wdDoNotSaveChanges at this point in your code?
> It needs to be 0 or False

It actually is 0.
> (I find it easier just to pass True or False
> in this argument rather than try to remember the names of the Word
> constants).

I have been advised to use predefined constant names since the
beginning of my programming in any language, just to cover future
changes... Is this wring?

> 2) If that's not the answer, is it possible that something you've done
> has created another document, or modified a template, without your
> noticing?

The target of that serial letter is set to "New Document", so a second
document is created in the process. Then the macro tries to close the
template to prevent the user from messing around with it. There the
request for a filename occurs.

Should'nt wdDoNotSaveChanges prevent this request even _if_ a macro
changed the template in the process?

Best regards,
Andreas
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.