Group: microsoft.public.word.vba.general
From: =?Utf-8?B?TWFyY2VlcG9v?= <36c53a08-2073470544@news.postalias>
Date: Friday, March 21, 2008 11:48 AM
Subject: vba to determine if text attribute (eg. of a table) is "hidden"

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

Safety Articles | Usenet Groups | Usenet News | Bluegrass