G
Gordon Bentley-Mix
Here's an odd one for you all:
Word 2003 under Windows XP
I have a template set up to toggle the visibility of certain portions of the
document depending on the values input through a UserForm. For example, if
the "Goods Schedule" checkbox is selected, the related "Goods Schedule" page
is displayed; if the checkbox isn't selected, then the page is hidden. This
is accomplished by wrapping the content in a bookmark and setting the Hidden
property of the Font bookmark's Range. I do this a lot, so I've written a
couple of "generic" procedures that accept arguments for toggling the
visibility, as follows:
Public Sub HideBookmarkRange(BkmkName As String)
With myDoc
If .Bookmarks.Exists(BkmkName) Then
..Bookmarks(BkmkName).Range.Font.Hidden = True
End With
End Sub
Public Sub ShowBookmarkRange(BkmkName As String)
With myDoc
If .Bookmarks.Exists(BkmkName) Then
..Bookmarks(BkmkName).Range.Font.Hidden = False
End With
End Sub
In some cases the content is a portion of a table (one or more rows), but of
course it's impossible to wrap a bookmark around a single row or several rows
within a table. In these instances, I've spilt the table at the appropriate
points and wrapped the bookmark around the whole table, including the
paragraph before the table. This works _most_ of the time.
HOWEVER... One table refuses to hide. The text within the table is formatted
as hidden, but the table itself is still visible. I've tried adding a
paragraph after the table and including this paragraph in the bookmark, and
I've even tried manually setting the font to hidden. Nothing seems to work.
As far as I can tell, this table is no different from any of the others in
the template. All of the properties are the same; the style applied to the
paragraph before the table is the same; and there are no styles applied to
any of the content within the table that aren't used in other tables
elsewhere.
Any ideas as to why this table and this table only refuses to play nice and
hide like the rest of them do?
--
Cheers!
Gordon Bentley-Mix
Word MVP
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
Word 2003 under Windows XP
I have a template set up to toggle the visibility of certain portions of the
document depending on the values input through a UserForm. For example, if
the "Goods Schedule" checkbox is selected, the related "Goods Schedule" page
is displayed; if the checkbox isn't selected, then the page is hidden. This
is accomplished by wrapping the content in a bookmark and setting the Hidden
property of the Font bookmark's Range. I do this a lot, so I've written a
couple of "generic" procedures that accept arguments for toggling the
visibility, as follows:
Public Sub HideBookmarkRange(BkmkName As String)
With myDoc
If .Bookmarks.Exists(BkmkName) Then
..Bookmarks(BkmkName).Range.Font.Hidden = True
End With
End Sub
Public Sub ShowBookmarkRange(BkmkName As String)
With myDoc
If .Bookmarks.Exists(BkmkName) Then
..Bookmarks(BkmkName).Range.Font.Hidden = False
End With
End Sub
In some cases the content is a portion of a table (one or more rows), but of
course it's impossible to wrap a bookmark around a single row or several rows
within a table. In these instances, I've spilt the table at the appropriate
points and wrapped the bookmark around the whole table, including the
paragraph before the table. This works _most_ of the time.
HOWEVER... One table refuses to hide. The text within the table is formatted
as hidden, but the table itself is still visible. I've tried adding a
paragraph after the table and including this paragraph in the bookmark, and
I've even tried manually setting the font to hidden. Nothing seems to work.
As far as I can tell, this table is no different from any of the others in
the template. All of the properties are the same; the style applied to the
paragraph before the table is the same; and there are no styles applied to
any of the content within the table that aren't used in other tables
elsewhere.
Any ideas as to why this table and this table only refuses to play nice and
hide like the rest of them do?
--
Cheers!
Gordon Bentley-Mix
Word MVP
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.