How to Disable Save message

B

BJ Kea

We have written an VB application that takes user data from a form and
populates bookmarks on a Word Template. The application has a Print Preview
feature that brings up the document in Word. The dot is locked so the user
can't modify it, but when the red-x in the upper right hand corner is pressed
to go back to the application; the user is prompted to “Save†the .dot copy.

We disabled the first “Save†message for the .doc version by issuing
objword.activedocument.saved

But now there is a message to save the .dot version. We have set the
documents “Read Only†property on so they can not save the document. We
would rather they not receive the message at all. We need a similar solution
to the above but for the .dot file.

Thanks
BJ
 
B

BJ KEA

This worked:
If strTypeOfPrint = "Preview" Then
objWord.CommandBars("Standard").Visible = False
objWord.CommandBars("Formatting").Visible = False
objWord.CustomizationContext = objWord.ActiveDocument.AttachedTemplate
objWord.CommandBars("File").Controls("&Save").Visible = False
'.OnAction = "OverridePrint"
objWord.CommandBars("File").Controls("Save &As...").Visible = False
'.OnAction = "OverridePrint"
objWord.CommandBars("File").Controls("P&rint...").Visible = False
'.OnAction = "OverridePrint"
objWord.CommandBars("File").Controls("Print Pre&view").Visible = False

objWord.ActiveDocument.Protect wdAllowOnlyComments, , strLtrPsw
'objWord.ActiveDocument.PrintPreview
objWord.Visible = True
objWord.ActiveWindow.Caption = "PREVIEW ONLY--DO NOT PRINT AND DO NOT
SAVE THIS TO ANY FILE"
'NEED BOTH OF THESE LINES
objWord.ActiveDocument.Saved = True
objWord.Templates(1).Saved = True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top