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
BJ KEA - 17 Jan 2005 23:19 GMT
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
> 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
[quoted text clipped - 12 lines]
> Thanks
> BJ