Excel VBA Macro: Send Email with Hyperlink (that has Spaces in the File Name)

  Рет қаралды 3,479

greggowaffles

greggowaffles

Күн бұрын

Excel VBA Macro: Send Email with Hyperlink (that has Spaces in the File Name). In this video, we go over how to ensure that a hyperlink with spaces in the filename does not get cut off after the first space.
Code (KZbin doesn't allow brackets; so LT and GT are used for less than and greater than, respectively):
Sub send_hyperlink_with_spaces()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim link As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
link = Replace(ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Text, " ", "%20")
MsgBox link
strbody = "LT BODY style = font-size:14pt; font-family:Arial GT" & _
"Hello Team, LT p GT Please see the link for today: " & _
"LT a href= " & link & "GT here LT / GT LTp GT" & _
"Best regards, LT br GT Greg"
On Error Resume Next
With OutMail
.to = "abc@123.com"
.CC = "me@me.com"
.BBC = ""
.Subject = "Morning Link " & Format(Date, "mm-dd-yyyy")
.display
.HTMLBody = strbody & .HTMLBody
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
#ExcelVBA #ExcelMacro

Пікірлер: 11
@finvest_queen
@finvest_queen 3 ай бұрын
amazing! thanks, like 👍👍👍
@moisestatis5418
@moisestatis5418 Жыл бұрын
Very good video, thank you!
@greggowaffles
@greggowaffles Жыл бұрын
Thanks for watching!
@shaikmohammed9971
@shaikmohammed9971 3 ай бұрын
Hey buddy, Thanks for the fantastic content. Just a quick question on font type/family. Though we selected Arial, draft is coming as Calibri. Can you please help?
@Nick_88888
@Nick_88888 Жыл бұрын
Very nice, thanks !
@greggowaffles
@greggowaffles Жыл бұрын
No prob! Thanks for watching
@Nick_88888
@Nick_88888 Жыл бұрын
@@greggowaffles any advice on how to learn all this, what topics to read, html vb ?
@greggowaffles
@greggowaffles Жыл бұрын
I would look for code that already exists, and make tweaks and edits, so that you can see how all of the moving parts work together. Also come up with your own vb projects so that you can test yourself and build upon what you know already. Just have fun with it!
@olabanjiolaniyan7066
@olabanjiolaniyan7066 Жыл бұрын
Ayeeeeeeee
@greggowaffles
@greggowaffles Жыл бұрын
😎😎
@moisestatis5418
@moisestatis5418 Жыл бұрын
I already mentioned how good of video this is. I tried and it worked just great. I just have a question. I tried sending a email to Outlook and the link worked fine. However, sending emails to Gmail o Yahoo the link does not show. Why is that? Thanks so much in advanced.
Excel VBA Macro: Send Email (with Hyperlink)
11:20
greggowaffles
Рет қаралды 11 М.
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 29 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 23 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 206 МЛН
Excel VBA Macro: Insert PivotTable (in Email Body)
9:19
greggowaffles
Рет қаралды 599
How to Get List of File Names in a Folder using Excel
5:40
Excel Weez
Рет қаралды 6 М.
Excel VBA Macro: Right Align Image in Email Body (and Resize)
11:14
greggowaffles
Рет қаралды 1,1 М.
Excel macro to set outlook mail body & HtmlBody | Lecture 8
5:48
Extreme Automation - Kamal Girdher
Рет қаралды 42 М.
Bulk Auto Emailer with Picture Signature and HTML body
25:51
PK: An Excel Expert
Рет қаралды 34 М.