C
Charles Kenyon
I'm trying to write procedures that intercept the FilePrint,
FilePrintDefault, & FilePrintPreview commands. I followed the directions on
the MVP FAQ page and got starter macros. The problem is that it works fine
for FilePrint & FilePrintDefault but doesn't seem to work with PrintPreview.
The procedure checks a table to see if anything has been entered in it. If
not, it hides the table. Then after printing or the preview it unhides the
table. This is because if I leave the table hidden (in a protected form)
Word zeros out any field within the table upon exiting the field.
The problem seems to be that Word unhides the table before displaying the
preview. My code is as follows:
Sub FilePrintPreview()
'
' FilePrintPreview Macro
' Displays full pages as they will be printed
'
HideTables
MsgBox "Tables hidden."
ActiveDocument.PrintPreview
ShowTables
MsgBox "Tables unhidden."
End Sub
TIA
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
FilePrintDefault, & FilePrintPreview commands. I followed the directions on
the MVP FAQ page and got starter macros. The problem is that it works fine
for FilePrint & FilePrintDefault but doesn't seem to work with PrintPreview.
The procedure checks a table to see if anything has been entered in it. If
not, it hides the table. Then after printing or the preview it unhides the
table. This is because if I leave the table hidden (in a protected form)
Word zeros out any field within the table upon exiting the field.
The problem seems to be that Word unhides the table before displaying the
preview. My code is as follows:
Sub FilePrintPreview()
'
' FilePrintPreview Macro
' Displays full pages as they will be printed
'
HideTables
MsgBox "Tables hidden."
ActiveDocument.PrintPreview
ShowTables
MsgBox "Tables unhidden."
End Sub
TIA
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.