1
想要替換一些字符串在Outlook中的郵件文件.have寫下面的代碼 但常量文件有表,如果我使用MyItem.HTMLBody不顯示。有沒有其他的選擇?oft outlook vba字符串替換不工作oft郵件與表
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myOlApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Dim up As Object
Dim ation As Object
Dim hsbcval As Object
up = TextBox1.Text
ation = TextBox2.Text
hsbcval = TextBox3.Text
myOlApp = CreateObject("Outlook.Application")
MyItem = myOlApp.CreateItemFromTemplate("D:\this.oft")
MyItem.HTMLBody = Replace(MyItem.HTMLBody, "IDSPUPZ", up)
MyItem.HTMLBody = Replace(MyItem.HTMLBody, "HANMZ", ation)
MyItem.HTMLBody = Replace(MyItem.HTMLBody, "HSBCVALZ", hsbcval)
MyItem.Display()
End Sub