A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

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.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ShowHiddenText assistance



 
 
Thread Tools Display Modes
  #1  
Old July 17th 12, 03:36 PM
Tjones8611 Tjones8611 is offline
Junior Member
 
First recorded activity by WordBanter: Jul 2012
Posts: 0
Default 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
Ads
  #2  
Old July 17th 12, 10:59 PM posted to microsoft.public.word.docmanagement
Stefan Blom[_3_]
external usenet poster
 
Posts: 6,539
Default 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





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 01:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.