Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear helpers,
I have a macro to create e-mail and send few charts to company stakeholders. My intention is to use HTML file emailrep.html as a default for body. This HTML file has more than 400 lines, so it is hard to convert it to a string using "& _" in the end of each line.
Pasting HTML code into Qlikview macro creates syntax error.
Set MyOlApp = CreateObject("Outlook.Application")
Set myItem = MyOlApp.CreateItem(olMailItem)
htmlfile = "Qlikview\emailrep.html"
With myItem
.To = Email.Item(i).Text
.BodyFormat = 2
.Subject = "Sales Report - " & Field.Item(i).Text
.HTMLBody = htmlfile
.Attachments.Add ("Report.pdf")
.Display
End With
Does anyone know how to get HTML file and use as e-mail body with this circumstances?
The use of Outlook is not mandatory. Just developed because it is easier for me.
I think you need to pass the html as string and not as a reference to a file (and it must be an absolute path and not a relative one) - have a look on these (similar) example: Re: Exportar varias tablas a un archivo html.
- Marcus
I think you need to pass the html as string and not as a reference to a file (and it must be an absolute path and not a relative one) - have a look on these (similar) example: Re: Exportar varias tablas a un archivo html.
- Marcus
Marcus,
I changed from Outlook to CDO object. Using CreateMHTMLBody method did exactly what I was looking for.
So, thank you much. I own you a beer.
Henrique