Naming and adding Hyperlinks

fish0321

New Member
Joined
Sep 15, 2020
Messages
14
Office Version
  1. 2016
Hi, all

I cannot figure out how to name my hyperlinks in my current code. I belive I need to change the .body to html to allow for this. Any help would be great.

]
VBA Code:
Sub emailPDF ()

ThisWorkbook.Sheets(Array("Cover Sheet", "XXX Names", "XXX Names 1")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"x:\xx\xxx\CHI XX\Test\CHI XXX " & Format(Date, "mmddyyyy") & ".pdf", Quality:=xlQualityStandard _
, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish _
:=False

' Prepare e-mail

Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim myAttachments As Object



Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
Set myAttachments = OutLookMailItem.Attachments

With OutLookMailItem
.To = "[EMAIL]XXX@yahoo.com[/EMAIL]"
.Subject = "Test"
.Body = "ALCON," & vbCr & vbCr & "Please see the attached xxx Report for " & Format(Date, "dddd, mmmm dd, yyyy.") _
& vbCr & vbCr & "https://fics.ishare.xxx/Fieldxxx/CHI/xxx/xxx/DATA/xxx/xxx_Schedule/Chicago%20Management%20xxx-2022.xlsm?web=1"

myAttachments.Add "x:\xxx\xxx\xxx\Test\CHI xxx " & Format(Date, "mmddyyyy") & ".pdf"

.display

End With



Set OutLookMailItem = Nothing
Set OutLookApp = Nothing

End Sub
]
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,838
Messages
6,121,885
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top