Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default outlook htmlbody

From Excel VBA, I am creating an outlook email message. I want to have the
body contain an html file. Is there any way to load this html from a file,
instead of having to put into the VBA code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default outlook htmlbody


Set objOutlook = New Outlook.Application
Set objEMailMsg = objOutlook.CreateItem(itemtype:=olMailItem)

'Show mail but don't actually send!
If sBody < "" Then
With objEMailMsg

.Subject = "P&P Summary for " & REPORTDATE

.HTMLBody = NameValue(NAV_MESSAGE) & vbCrLf & sBody

.Display

End With





"Erin" wrote:

From Excel VBA, I am creating an outlook email message. I want to have the
body contain an html file. Is there any way to load this html from a file,
instead of having to put into the VBA code?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default outlook htmlbody

I forgot to alter something.

NameValue(NAV_MESSAGE) & vbCrLf & sBody

is simple the path to the html file plus some additional text
eg
.HTMLBody = "C:\Demo.html" & vbCRLF & "Hello World!"

"Patrick Molloy" wrote:


Set objOutlook = New Outlook.Application
Set objEMailMsg = objOutlook.CreateItem(itemtype:=olMailItem)

'Show mail but don't actually send!
If sBody < "" Then
With objEMailMsg

.Subject = "P&P Summary for " & REPORTDATE

.HTMLBody = NameValue(NAV_MESSAGE) & vbCrLf & sBody

.Display

End With





"Erin" wrote:

From Excel VBA, I am creating an outlook email message. I want to have the
body contain an html file. Is there any way to load this html from a file,
instead of having to put into the VBA code?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel open in outlook if outlook is running kirk Excel Discussion (Misc queries) 0 May 24th 06 06:42 PM
Outlook 11 Outlook 10 Object Library Compatibility Issues Paul Mac[_4_] Excel Programming 11 May 19th 06 04:27 AM
Send to Outlook 2000 not Outlook Express Jimbo Excel Discussion (Misc queries) 2 January 4th 05 08:19 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"