Help with VBA Hyperlink issues

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
378
We have some code that formats an outgoing email and it works great.

Code:
With Sheets(1)
  strBody = "<I><font size = 6><FONT COLOR = RED>This order is now directed to Scheduling</font color><BR>Please evaluate Order Entry Log for Status" & "</FONT>" & "</I>" & "<p>" & vbCr & _
                    "<FONT COLOR = BLUE><font size = 5>In Process (Yellow):     Not Live" & "</font color>" & "</FONT>" & "<p>" & vbCr & _
                    "<FONT COLOR = BLUE><font size = 5>Ready (Green):     Ready to Schedule Board" & "</font color>" & "</FONT>" & "<p>" & vbCr & _
                    "<FONT COLOR = BLUE><font size = 5>View the log here:     G:\General\SLZ\SloDesign\NEW ORDER ENTRY\NOEL2018\OEL 2018.XLSM" & "</font color>" & "</FONT>" & "<p>" & "</A>" & vbCr & _
                    "***************************************<FONT COLOR = black><font size = 5>  " & "</font color>" & "</FONT>" & "<p>" & vbCr & _
                    "Customer -<FONT COLOR = RED><font size = 4> " & .Range("J" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "Sales Person -<FONT COLOR = RED><font size = 4>  " & .Range("B" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "Customer Service Rep -<FONT COLOR = RED><font size = 4>  " & .Range("C" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "Order Received -<FONT COLOR = RED><font size = 4>  " & .Range("I" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "Order Number -<FONT COLOR = RED><font size = 4>  " & .Range("AH" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "PO # -<FONT COLOR = RED><font size = 4>  " & .Range("K" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "NIR # -<FONT COLOR = RED><font size = 4>  " & .Range("A" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
                  "Due Date -<FONT COLOR = RED><font size = 4>  " & .Range("L" & ActiveCell.Row).Value & "</font color>" & "</FONT>" & "<BR>" & vbCr & _
               "***************************************<FONT COLOR = black><font size = 5>  " & "</font color>" & "</FONT>" & "<p>" & vbCr & _
                "<I><font size = 4>Please DO NOT reply<FONT COLOR = black> " & "</font color>" & "</FONT>" & "</I>" & "<p>"
                
                
                
                End With

this is my dim setup

Code:
Public Sub SendMail11()
 Application.ScreenUpdating = False
Dim strTo As String, strBody As String
Dim objOutLook As Object, objMail As Object
    Set objOutLook = CreateObject("Outlook.Application")
    Set objMail = objOutLook.CreateItem(0)


I want to add this to create a hyperlink to the log

Code:
   strBody = "<HTML>******>"
    strBody = strBody & "<A href=R:\General\SLZ\SloDesign\NEW%20ORDER%20ENTRY\NOEL2018\OEL%202018.XLSM>Click-Here to view the Order entry Log.</A>"
    strBody = strBody & "</BODY></HTML>"

if I place the code above (html) before with sheets(1) - nothing happens and I get the formatted body of the email
but If I place the html code after End With
the hyperlink works great but the formatted email is not there.

We would like to included the formatted email in the body
along with a working hyperlink to an intranet location.


Thanks in advance.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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