M
Marceepoo
I can't figure out how to use vba to ascertain whether the text attribute of
a table (or other text) that is selected (or which I identify using a range
object) is "hidden".
Does anyone have any suggestions where I could get info about this?
I'm using Word Profl. 2003 in WinXp.
Thanks,
marceepoo
p.s. The following code contains my last failed attempt. Any suggestions
for corrections would be much appreciated.
Sub HiddnOrNot()
Dim oRng1 As Table
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
Selection.GoTo What:=wdGoToBookmark, Name:="Tableofreplacements"
Selection.Tables(1).Select
Set oRng1 = Selection.Tables(1)
If Selection.Font.Hidden = False Then
' If oRng1.Range.Font.Hidden = False Then
MsgBox "Table is visible, i.e., Hidden = False - Success!" & _
vbCrLf & "Press OK to make it invisible"
oRng1.Range.Font.Hidden = True
Selection.HomeKey Unit:=wdStory
Selection.GoTo What:=wdGoToBookmark, Name:="Tableofreplacements"
Selection.Tables(1).Select
Set oRng1 = Selection.Tables(1)
Else
MsgBox "Table is INvisible, i.e., Hidden = True - Press Ok to fix
this.!"
oRng1.Range.Font.Hidden = False
MsgBox "Table sb visible now!"
End If
End Sub
a table (or other text) that is selected (or which I identify using a range
object) is "hidden".
Does anyone have any suggestions where I could get info about this?
I'm using Word Profl. 2003 in WinXp.
Thanks,
marceepoo
p.s. The following code contains my last failed attempt. Any suggestions
for corrections would be much appreciated.
Sub HiddnOrNot()
Dim oRng1 As Table
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
Selection.GoTo What:=wdGoToBookmark, Name:="Tableofreplacements"
Selection.Tables(1).Select
Set oRng1 = Selection.Tables(1)
If Selection.Font.Hidden = False Then
' If oRng1.Range.Font.Hidden = False Then
MsgBox "Table is visible, i.e., Hidden = False - Success!" & _
vbCrLf & "Press OK to make it invisible"
oRng1.Range.Font.Hidden = True
Selection.HomeKey Unit:=wdStory
Selection.GoTo What:=wdGoToBookmark, Name:="Tableofreplacements"
Selection.Tables(1).Select
Set oRng1 = Selection.Tables(1)
Else
MsgBox "Table is INvisible, i.e., Hidden = True - Press Ok to fix
this.!"
oRng1.Range.Font.Hidden = False
MsgBox "Table sb visible now!"
End If
End Sub