Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Hidding test based on style

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Starr - 29 Sep 2005 06:16 GMT
Some time ago the following code was posted to this newsgroup as a way to
hide/display text based on its style.

Sub ShowMessages()
  With ActiveDocument
     .Styles("Message").Font.Hidden = False
     .Styles("Summary").Font.Hidden = True
  End With
End Sub

Sub ShowSummaries()
  With ActiveDocument
     .Styles("Message").Font.Hidden = True
     .Styles("Summary").Font.Hidden = False
  End With
End Sub

Sub ToggleMessages()
  With ActiveDocument
     If .Styles("Summary").Font.Hidden = False Then
        .Styles("Message").Font.Hidden = False
        .Styles("Summary").Font.Hidden = True
     Else
        .Styles("Message").Font.Hidden = True
        .Styles("Summary").Font.Hidden = False
     End If
  End With
End Sub

I have created a document (attached) that has lines of text that are
alternately formatted using Summary Style or Message Style.
I find that the ShowMessages macro hides all text regardless of style and
ShowSummaries shows all rext regardless of style.
I feel I am doing something fundamentally wrong. Can you offer any
assistance?

Many Thanks
Tony Starr

PS. I am using Word xp
Klaus Linke - 29 Sep 2005 18:23 GMT
Hi Tony,

The attachment didn't make it to the MS news server, but it seems likely
that your "Message" style is based on the "Summary" style?

Regards,
Klaus

> Some time ago the following code was posted to this newsgroup as a way to
> hide/display text based on its style.
[quoted text clipped - 36 lines]
>
> PS. I am using Word xp

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.