I have a bit of code that takes what is on the clipboard and pastes it into a Outlook 2003 message as a hyperlink. The clipboard contents should be the fullname(path and filename) obtained from another macro in Word 2003 (ActiveDocument.FullName). The Outlook message format is set to HTML. I have a function(GetFilename) that takes the string(strClip) and returns only the filename to display only that for the hyperlink. My objective is to be able to paste multiple links to an email message. It all seems to work except that it won't allow me to paste another link into the email and the curser jumps back to the beginning of the pasted link. It overwrites the initial paste. For the carriage return I've tried "& vbCrLf", "& Chr(13)" and "& <br>" to get the return, but nothing has worked. Thanks in advance for any help with this. The code is below:
[VBA]
Sub PasteLink()
Dim MyData As DataObject
Dim strClip As String
Dim msg As Outlook.MailItem
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
strShortClip = GetFilename(strClip)
Set msg = Application.ActiveInspector.CurrentItem
msg.HTMLBody = "<a href=" & strClip & ">" & strShortClip & "</a>" & "<br>"
End Sub
[/VBA]