2010-05-26 36 views
0

當我嘗試在outlook電子郵件中創建兩個文件作爲鏈接時,只有其中一個文件顯示爲鏈接。我該如何解決這個問題,因此兩者都會顯示爲鏈接。在VBA中添加多個鏈接

設置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

你必須與你的代碼有問題。你應該重置HTMLBody,當你連接它們。

試試這個:

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 

提示:人們會更傾向於回答你的問題,如果你通過接受你過去的問題的一些答案增加您的接受率。爲免費提供幫助的人提供幾個代表點並不需要花費任何代價。

+0

你是怎麼做到的? – Edmond 2010-05-26 22:04:50

+0

謝謝你的幫助 – Edmond 2010-05-26 22:05:12

+0

你怎麼做? – JohnFx 2010-05-26 22:10:50