![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Ads | |
|
#2
|
|||
|
|||
|
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 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assistance required | Bryan | Microsoft Word Help | 1 | February 2nd 09 11:03 AM |
| printing assistance | ollie | Microsoft Word Help | 0 | May 21st 08 04:38 PM |
| TOC Assistance | Vinnie | Microsoft Word Help | 2 | May 1st 08 03:11 PM |
| Assistance in template development | ACA_Office | Microsoft Word Help | 1 | September 29th 06 09:56 PM |
| autocorrect assistance | MARISA | Microsoft Word Help | 1 | August 3rd 06 09:14 AM |