Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-17-2011, 02:18 PM
macropod's Avatar
macropod macropod is offline VBA find or name a Table Windows 7 32bit VBA find or name a Table Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi smed,

If you bookmark the table, you can find the first table in the bookmarked range. For example:
Code:
celltext = ActiveDocument.Bookmarks("Table1").Range.Tables(1).Cell(1, 1).Range.Text
Do note, though, that specifying 'Cell(1, 1).Range.Text' picks up the end-of-cell marker. To get just the cell's text range, use something like:
Code:
Dim CelRng As Range
Set CelRng = ActiveDocument.Bookmarks("Table1").Range.Tables(1).Cell(1, 1).Range
CelRng.End = CelRng.End - 1
celltext = CelRng.Text
To bookmark a table, you don't need to select the whole table. You can simply bookmark any of the end-of-row markers.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 01-17-2011 at 07:25 PM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
find and replace anil3b2 Word 0 08-03-2010 11:30 PM
VBA find or name a Table can Find/Replace NOT find something? Bobosmite Word 6 05-27-2010 08:09 PM
Pasting table in Photoshop cutting off table azdolfan Word Tables 0 05-16-2010 01:52 PM
Find Hyperlinks jimbassett Excel 2 02-08-2010 08:08 AM
VBA find or name a Table Find and add new Shapes bonani PowerPoint 1 11-26-2009 06:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft