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 / December 2004

Tip: Looking for answers? Try searching our database.

Adding two bookmarks to a cell in a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen English - 09 Dec 2004 07:15 GMT
I want to add two bookmarks to a cell in a table so that I can then add a
Committee Name to one and a Date to another because I want to retrieve them
later as separate items.
With mytable
          .Cell(1, 3).Range.Bookmarks.Add "Ctte"
          .Cell(1, 3).Range.Bookmarks.Add "Date"
End With
This just adds both bookmarks to the cell whereas I want it to be
[Committee]  [Date]
Any ideas please?
Stephen
Helmut Weber - 09 Dec 2004 10:07 GMT
Hi Stephen,
how about this one:

Sub Test984()
Dim oRng As Range
Set oRng = ActiveDocument.Tables(1).Cell(1, 1).Range
Resetsearch
With oRng
  .Delete
  .Text = "Committee    Date"
   With .Find
     .Text = "Committee"
     .Execute
   End With
  .Bookmarks.Add Name:="Ctte"
  .Collapse Direction:=wdCollapseEnd
   With .Find
     .Text = "Date"
     .Execute
   End With
  .Bookmarks.Add Name:="Date"
End With
End Sub

Sub ResetSearch()
With Selection.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  .Forward = True
  .Wrap = wdFindContinue
  .Format = False
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Execute
End With
End Sub

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
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.