Hi,
I am looking for a way to find the first table before the pointer and then
to select this Table in order to reformat the table properties.
Any ideas ?
Nde
Helmut Weber - 13 Jun 2007 16:34 GMT
Hi,
>I am looking for a way to find the first table before the pointer and then
>to select this Table in order to reformat the table properties.
pointer is not a terminus technicus (term) in Word,
though in some programming languages.
I am assuming you mean the insertion point.
Sub Testq()
Dim rTmp As Range
Set rTmp = Selection.Range
rTmp.start = ActiveDocument.Range.start
If rTmp.Tables.Count > 0 Then
rTmp.Tables(rTmp.Tables.Count).Select
Else
MsgBox "no table before IP"
End If
End Sub
HTH

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Klaus Linke - 13 Jun 2007 17:41 GMT
> Hi,
>
> I am looking for a way to find the first table before the pointer and then
> to select this Table in order to reformat the table properties.
>
> Any ideas ?
Hi Nde,
Or, as in the interface, you could use the browser:
Dim oldTarget
oldTarget = Application.Browser.Target
Application.Browser.Target = wdBrowseTable
Application.Browser.Previous
Selection.Tables(1).Select
Application.Browser.Target = oldTarget
Regards,
Klaus