D
Deejay
I have at the moment some code which allows me through a macro to make
graphics visibile or hidden. I am trying to add some code which makes some
bookmarks visible/hidden to be nested within the With that is already there.
So in effect there will be 3 states and the macro will toggle between those
states.
1. graphics visible
2. graphics and bookmarks hidden
3. graphics hidden but bookmarks visible.
I have placed a * at the beginning of those lines that I'm not sure about
and I require help on.
Many many thanks
Dim boolFax As Boolean
Dim boolBookMark As Boolean
Dim aShape As Shape
*Dim aBookmark As Bookmark
With ActiveDocument
' Check current status - it's in fax format if graphics are visible
boolFax = .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1).Visible
*boolBookMark = .
' Show/Hide the graphics
With .Sections(1)
For Each aShape In .Headers(wdHeaderFooterFirstPage).Shapes
aShape.Visible = Not boolFax
*With ActiveDocument.Bookmarks
* For Each aBookmark In ActiveDocument.Bookmarks
* aBookmark.Range.Font.Hidden = Not boolBookmark
* Next aBookmark
* End With
Next aShape
End With
graphics visibile or hidden. I am trying to add some code which makes some
bookmarks visible/hidden to be nested within the With that is already there.
So in effect there will be 3 states and the macro will toggle between those
states.
1. graphics visible
2. graphics and bookmarks hidden
3. graphics hidden but bookmarks visible.
I have placed a * at the beginning of those lines that I'm not sure about
and I require help on.
Many many thanks
Dim boolFax As Boolean
Dim boolBookMark As Boolean
Dim aShape As Shape
*Dim aBookmark As Bookmark
With ActiveDocument
' Check current status - it's in fax format if graphics are visible
boolFax = .Sections(1).Headers(wdHeaderFooterFirstPage).Shapes(1).Visible
*boolBookMark = .
' Show/Hide the graphics
With .Sections(1)
For Each aShape In .Headers(wdHeaderFooterFirstPage).Shapes
aShape.Visible = Not boolFax
*With ActiveDocument.Bookmarks
* For Each aBookmark In ActiveDocument.Bookmarks
* aBookmark.Range.Font.Hidden = Not boolBookmark
* Next aBookmark
* End With
Next aShape
End With