tags:

views:

19

answers:

1

When I try and create both of the files as links within the outlook email, only one of the files shows up as a link. How can I resolve this so both will show up as links.

Set omail = CreateItem(olMailItem)

    With omail

    .Subject = "Key Report"
    .BodyFormat = olFormatHTML
    .HTMLBody = "<a href ='" & fileL & "'>Key Report</a>"
    .HTMLBody = "<a href ='" & fileSat & "'>Key Report Saturday</a>"
    .To = [email protected]       
    .Display

    End With
+1  A: 

You have a problem with your code. You are resetting the HTMLBody, when you should concatenate them.

try this:

Set omail = CreateItem(olMailItem)

With omail
  .Subject = "Key Report"
  .BodyFormat = olFormatHTML
  .HTMLBody = "<a href ='" & fileL & "'>Key Report</a>" & _ 
              "<a href ='" & fileSat & "'>Key Report Saturday</a>"
  .To = [email protected]       
  .Display
End With

Tip: People will be more inclined to answer your questions if you increase your acceptance rate by accepting some answers on your past questions. It doesn't cost anything to give a few rep points to people who help you out for free.

JohnFx
how do you do that?
Edmond
Thank you for your help
Edmond
How do you do what?
JohnFx
Edmond, there is a checkmark outline to the left of the answer. If you click on that, it indicates that you have accepted one of the answers to your question. This gives the answerer 15 points and indicates to the rest of the community that your issue has been resolved to your satisfaction. Your acceptance rate is displayed when you ask a question.