Hi All:
Windows 2k
Word 2K
I have written a piece of code that picks up the name of a bookmark, goes to
Table1 in my document, adds a new row and inserts the bookmark text and page
number. I now need the insertion point to return to the location in the
document that it was prior to entering the bookmark info into Table 1.
Code snippet:
oTable.Range.Rows(oTable.Rows.Count).Range.Select
Selection.InsertRowsBelow 1
Selection.Collapse (wdCollapseStart)
myrow = Selection.Information(wdStartOfRangeRowNumber)
If strHeaderText = " in-Ch." Then
With Selection
.TypeText Text:=StrConv(Trim(strFWitnessName),
vbProperCase)
.MoveLeft unit:=wdWord, Count:=3, Extend:=wdExtend
.Font.UnderLine = wdUnderlineNone
.MoveRight unit:=wdCell
Selection.InsertCrossReference
ReferenceType:="Bookmark", ReferenceKind:= _
wdPageNumber, ReferenceItem:=strBN,
InsertAsHyperlink:=True, _
IncludePosition:=False
End With
End If
AT THIS POINT I NEED TO RETURN THE INSERTION POINT TO ITS LOCATION PRIOR TO
EXECUTING ABOVE CODE. I'm quite certain I could use yet another bookmark
but is there another way?
TIA for any help!
Debra
Jonathan West - 19 Jan 2005 13:52 GMT
Hi debra
Add this to the start of your code
Dim oRange as Range
Set oRange = Selection.Range
At the end, add this line of code
oRange.Select

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
> Hi All:
>
[quoted text clipped - 40 lines]
>
> Debra
Debra Farnham - 19 Jan 2005 13:55 GMT
Amazing!
Thank you so much for your help Jonathan!
Debra
> Hi debra
>
[quoted text clipped - 51 lines]
> >
> > Debra