Old Post-----------
Hi Guys,
Sorry I wasn't clearer.
I'm selecting the text in the paragraph manually....say the paragraph
looked like this -
"My Paragraph has SELECTED TEXT and this is what I want to be a link
entering a new word HERE".
I've tried insertafter but it goes after the paragraph and onto the new
line when I use with myRng.MoveEnd...didn't try wdcollapseEnd though.
Dim myrng As Range
Set myrng = Selection.Range
myrng = myrng.Paragraphs(1).Range
myrng.MoveEnd
myrng.InsertAfter " MyText"
Cheers
J
---------------------
Forgot to mention that after the text is selected in the para the user
clicks a custom macro button, the macro Changes the selection to make
the selected text the anchor and inserts text before the anchor which is
the Href to the linked document.
So I can't select the whole para at the start as I'll lose my selection
and I can't select the whole para at the end as I'll lose my formatting
for the anchor.
Cheers
J
Dave Lett - 03 Nov 2004 17:38 GMT
Hi JB,
I think you're looking for something like the following:
Dim oRng As Range
Set oRng = ActiveDocument.Range _
(Start:=Selection.Paragraphs(1).Range.End - 1, _
End:=Selection.Paragraphs(1).Range.End - 1)
oRng.InsertAfter Text:="New Text"
HTH,
Dave
> Old Post-----------
>
[quoted text clipped - 36 lines]
>
> J
JB - 04 Nov 2004 12:58 GMT
> Hi JB,
>
[quoted text clipped - 50 lines]
>>
>>J
So simple when you know how..... :-)
Thanks Dave.
J