View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default How to mark text so that it always shows on screen, but never

Hi ?B?ZGFuNDAwbWFu?=,

I am almost clueless when it comes to
developing Office macros, so while your suggestion *sounds* good, I am not
clear on how to accomplish. I imagine the two "actions" I need to cover are
on the open of the document and the close of it. As far as how to store
current settings in variables, and how those settings are accessed (what
they're called and how are they placed into and restored from a variable), I
have no idea.

If you could provide a source of information that would enable me accomplish
this task, I would greatly appreciate that!

Here's some sample code. It should execute automatically when the document in
which it is placed is opened / closed. Or, it could be put in a template to
which the document is attached.

Sub AutoOpen()
Dim doc As Word.Document
Dim vw As Word.View

Set doc = ActiveDocument
Set vw = doc.ActiveWindow.View
doc.Variables("ShowHidden") = vw.ShowHiddenText
doc.Variables("PrintHidden") = Options.PrintHiddenText
vw.ShowHiddenText = True
Options.PrintHiddenText = False
End Sub

Sub AutoClose()
Dim doc As Word.Document

Set doc = ActiveDocument
doc.ActiveWindow.View.ShowHiddenText _
= CBool(doc.Variables("ShowHidden"))
Options.PrintHiddenText = _
CBool(doc.Variables("PrintHidden"))
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)