Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Find previous Table and select Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nde - 13 Jun 2007 16:17 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 ?

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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.