Help with VBA Hyperlink issues

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
371
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.
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,108,816
Messages
5,525,064
Members
409,617
Latest member
Lenaf

This Week's Hot Topics

Top