Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

VBScript, Word, Printing and (not) saving.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gemma M - 19 Jan 2005 11:40 GMT
Hi,

I have a VBScript which runs up Word on a file, allowing the user to print
it.  However, when they print the document, on exit, it causes the "Do you
want to save changes to document?" message to appear.

This I do not want.

I only want the "Do you want to save changes..." message box when the user
has actually made changes, no when all he has done is printed the document,
before closing.

Can I, from VBScript, prevent the document-print operation from causing a
saveable change to the document?

Gem
McKirahan - 19 Jan 2005 12:19 GMT
> Hi,
>
[quoted text clipped - 12 lines]
>
> Gem

Programmatically turn off warning messages in MS Office applications
http://www.a1vbcode.com/vbtip.asp?ID=66

Application.DisplayAlerts = wdAlertsNone

Global Const wdAlertsAll = -1
Global Const wdAlertsMessageBox = -2
Global Const wdAlertsNone = 0

http://www.progresstalk.com/printthread.php?t=25614
Gemma M - 19 Jan 2005 14:18 GMT
Hi,

Thanks for this, but I already tried it, and it doesn't work.  Word is
obviously fooled into thinking that something within the document is changed
when it is printed, but whatever the something is, I cannot find it.  There
are no PrintDate fields.

So, I am still at a loss.

The other thing I have found is that if I open the document read-only, then
there is no "Do you want to save changes..." message after a print.
However, if a user genuinely has changed the document, when he closes it, he
gets the "Save as..." dialogue, and we don't want users saving the document
under different names (in fact, when I run Word, I make "Save As..."
invisible on the menu).

So, I'm stuck between a rock and a hard place currently, and it's an
uncomfortable place to be, I can tell you.

Gem

>> Hi,
>>
[quoted text clipped - 27 lines]
>
> http://www.progresstalk.com/printthread.php?t=25614
Steve Yandl - 19 Jan 2005 15:14 GMT
I've used what follows in a few scripts.  oWd is my Word Application object.

oWD.ActiveDocument.Close wdDoNotSaveChanges
oWD.Quit
Set oWD=Nothing

Steve

> Hi,
>
[quoted text clipped - 49 lines]
>>
>> http://www.progresstalk.com/printthread.php?t=25614
Gemma M - 19 Jan 2005 15:31 GMT
Thanks Steve,

Unfortunately, what is happening is VBScript is opening the document in Word
and then allowing the user to close it when he has finished with it (after
printing it, etc).  So, once Word is running, VBScript has not control over
what is happening.  But the users do not consider printing a document as
changing it, so they are confused about the save-changes message.

However, I think I may have found out the problem.  In some documents, the
Document.BuiltinDocumentProperties.Item(10) contains a valid LastPrintedDate
value, and some do not.  If I can make that date invalid, then Word will
neglect to update it when the document in printed.

So, does anyone know how to make the "Last Printed Date" built-in property
invalid, so that printing the document does not update it? (I might post
this as a new query)

Gem

> I've used what follows in a few scripts.  oWd is my Word Application
> object.
[quoted text clipped - 58 lines]
>>>
>>> http://www.progresstalk.com/printthread.php?t=25614

Rate this thread:






 
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.