У меня есть следующий код и я хочу вставить гиперссылку в переменную display:
xRecipName = Split("https://www.alumbra.com.br/pesquisa.php?x=" & xRecipAddress)(0)
Sub InsertRecipientNamesToBody()
Dim xMailItem As Outlook.MailItem
Dim xRecipient As Outlook.Recipient
Dim xRecipAddress, xRecipNames, xRecipName, xFilterAddr As String
Dim xItems As Outlook.Items
Dim i As Integer
Dim xFoundContact As Outlook.ContactItem
Dim xDoc As Word.Document
On Error Resume Next
Set xMailItem = Outlook.ActiveInspector.CurrentItem
xMailItem.Recipients.ResolveAll
For Each xRecipient In xMailItem.Recipients
xRecipAddress = xRecipient.Address
MsgBox (xRecipient.Address)
Set xItems = Application.Session.GetDefaultFolder(olFolderContacts).Items
For i = 1 To 3
xFilterAddr = "[Email" & i & "Address] = " & xRecipAddress
If Not (xFoundContact Is Nothing) Then
xRecipNames = xRecipNames & xFoundContact.FullName & Chr(10)
Exit For
End If
Next
xRecipName = Split("https://www.alumbra.com.br/pesquisa.php?x=" & xRecipAddress)(0)
xRecipNames = xRecipNames & xRecipName & Chr(10)
Next
Set xDoc = xMailItem.GetInspector.WordEditor
xDoc.Content.InsertAfter xRecipNames
Set xMailItem = Nothing
Set xRecipient = Nothing
Set xItems = Nothing
Set xFoundContact = Nothing
End Sub