Thanks for responding Sue. I have been away for awhile which is why I have
not responded. If the myRange = objDoc.Content which represents the entire
document; how do I say "put this hyperlink at the very end (after the last
line) of myrange? I have your book; would this be covered somewhere in the
book? I have been coding VBA in Excel for many years (self taught), but I am
very new to Outlook so I apologize if I'm struggling to get this to make
sense.
"Sue Mosher [MVP]" wrote:
> The first parameter of the Hyperlinks.Add method refers to the position
> where you want to link to appear. As Ken suggested, the Document.Content
> object returns a Range that represents the entire document. Thus, you should
> be able to use that range in your Hyperlinks.Add statement:
> Set myRange = objDoc.Content
> objDoc.Hyperlinks.Add myRange, strLink, _
> "", "", strLinkText, ""
> > Sue Mosher
> > >
> "RHFinCT" <RHFinCT> wrote in message
> news:71D3C88F-EB8C-4111-8DB8-C4CC9E0810B1@microsoft.com...
> > I'm not trying to add text; I'm trying to add a hyperlink using
> > objDoc.Hyperlinks.Add objSel.Range, strLink, _
> > "", "", strLinkText, ""
> > The add method I am referring to is available in the hyperlinks
> > collection.
> > I am able to successfuly add a hyperlink, but for reasons I won't bore you
> > with, it needs to follow (be at the end of) any text that already exists
> > in
> > the body text window. After doing this; I then need to know how to find
> > and
> > modify the hyperlink when the destination changes. Thanks very much.
> > " - " wrote:
> >
> >> What Add method are you talking about?
> >
> >> To insert the text you want at the very end of the Word Document object
> >> you
> >> could even use this one liner, assuming that doc is your Document object:
> >
> >> doc.Content.InsertAfter strLink
>
> >
> >> "RHFinCT" <RHFinCT> wrote in message
> >> news:AE29E3D9-FC93-47DD-9304-5AAA2A1DF2CE@microsoft.com...
> >> > Thanks again Ken; I really do appreciate your assistance. The code
> >> > you're
> >> > suggesting works and I completely understand why, but I can't seem to
> >> > replicate the "insertafter" behavior when inserting a hyperlink. The
> >> > only
> >> > useful method for the hyperlink object seems to be the Add method.
> >> >> > It's seems as though I would either have to be able to set the point of
> >> > insertion to the characterposition after the last charachter in the
> >> > appointment body text. The only other idea I have is to insert a string
> >> > (which I know how to do) at the end of the body text and then always
> >> > search
> >> > for that string, select it and convert it into a hyperlink (if that's
> >> > possible). Once again; thanks for your patience and assistance with
> >> > this
> >> > issue.
> >
> >>
>