Home |
Search |
Today's Posts |
#1
|
|||
|
|||
ShowHiddenText assistance
I thought this was going to be simple, but I m ust be over complicating things. I’m using Word 2007 to create a report template. I have headings for multiple sections that I want displayed on the monitor, but not when the report is printed. I have used hidden text formatting and a macro to automate the “Hidden Text” under options-Display without any luck. Any advice or suggestions for code? Basically, I want to auto-enable “Hidden Text” anytime a user opens the template for creating a report.
Im using Word macro-Enabled Doc - .docm to create the template, not sure if this might be part of the problem Code Im using: With ActiveDocument .ActiveWindow.View.ShowHiddenText = False 'Do not display hidden text .Application.Options.PrintHiddenText = False 'Do not print hidden text End With |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
ShowHiddenText assistance
Since you just want to prevent the hidden text from printing,
intercepting the FilePrint and FilePrintDefault commands should suffice. Using Save As, turn your form into a macro-enabled template (if you haven't already done that). Create a module and add the following code: Sub FilePrint() Dim IsHiddenTextPrinting As Boolean IsHiddenTextPrinting = Options.PrintHiddenText Options.PrintHiddenText = False Dialogs(wdDialogFilePrint).Show Options.PrintHiddenText = IsHiddenTextPrinting End Sub Sub FilePrintDefault() Dim IsHiddenTextPrinting As Boolean IsHiddenTextPrinting = Options.PrintHiddenText Options.PrintHiddenText = False ActiveDocument.PrintOut Options.PrintHiddenText = IsHiddenTextPrinting End Sub Stefan Blom Microsoft Word MVP On 2012-07-17 16:36, Tjones8611 wrote: I thought this was going to be simple, but I m ust be over complicating things. I’m using Word 2007 to create a report template. I have headings for multiple sections that I want displayed on the monitor, but not when the report is printed. I have used hidden text formatting and a macro to automate the “Hidden Text” under options-Display without any luck. Any advice or suggestions for code? Basically, I want to auto-enable “Hidden Text” anytime a user opens the template for creating a report. Im using Word macro-Enabled Doc - .docm to create the template, not sure if this might be part of the problem Code Im using: With ActiveDocument .ActiveWindow.View.ShowHiddenText = False 'Do not display hidden text .Application.Options.PrintHiddenText = False 'Do not print hidden text End With |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assistance required | Microsoft Word Help | |||
printing assistance | Microsoft Word Help | |||
TOC Assistance | Microsoft Word Help | |||
Assistance in template development | Microsoft Word Help | |||
autocorrect assistance | Microsoft Word Help |