Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.outlook.program_vba
external usenet poster
 
Posts: 25
Default how to send a html message from excel

I am trying to create a HTML email. When I do it, all of the strings are
trunicated to only include what is showing in the worksheet. If a cell is
narrower then the line of text, it only includes that parts that are
showing.


Here is the code I use to build the message:

Set rng = Sheets("Marketing-letter").Range("A1:A28")


For Each oAccount In OutApp.Session.Accounts
If oAccount.AccountType = olPop3 Then
If oAccount.DisplayName = " Then
MsgBox "Sending out!"


Dim oMail As Outlook.MailItem
Set oMail = OutApp.CreateItem(olMailItem)
oMail.To = emailname
oMail.CC = ""
oMail.BCC = bbcname
oMail.Subject = "my subject"
oMail.Recipients.ResolveAll
oMail.HTMLBody = RangetoHTML(rng) '& vbNewLine & vbNewLine &
signature
oMail.Attachments.Add ("C:\notary\myattachment.pdf")
oMail.SendUsingAccount = oAccount
oMail.Send

Sheets("Marketing").Select
Range("L" & rowi).Select
ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 & " Sent: " &
Format(Now, "mmm-d-yyyy hh:mm")



'Range("BR29").Select
'.temp_.Select



End If

End If
Next

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.outlook.program_vba
external usenet poster
 
Posts: 11,123
Default how to send a html message from excel

Hi Bruce

That's the way the function is working Bruce

You can try this
http://support.microsoft.com/default...b;en-us;816644


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bruce" wrote in message ...
I am trying to create a HTML email. When I do it, all of the strings are
trunicated to only include what is showing in the worksheet. If a cell is
narrower then the line of text, it only includes that parts that are
showing.


Here is the code I use to build the message:

Set rng = Sheets("Marketing-letter").Range("A1:A28")


For Each oAccount In OutApp.Session.Accounts
If oAccount.AccountType = olPop3 Then
If oAccount.DisplayName = " Then
MsgBox "Sending out!"


Dim oMail As Outlook.MailItem
Set oMail = OutApp.CreateItem(olMailItem)
oMail.To = emailname
oMail.CC = ""
oMail.BCC = bbcname
oMail.Subject = "my subject"
oMail.Recipients.ResolveAll
oMail.HTMLBody = RangetoHTML(rng) '& vbNewLine & vbNewLine &
signature
oMail.Attachments.Add ("C:\notary\myattachment.pdf")
oMail.SendUsingAccount = oAccount
oMail.Send

Sheets("Marketing").Select
Range("L" & rowi).Select
ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 & " Sent: " &
Format(Now, "mmm-d-yyyy hh:mm")



'Range("BR29").Select
'.temp_.Select



End If

End If
Next

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
Add link to specific Excel worksheet in HTML Outlook message [email protected] Links and Linking in Excel 4 May 17th 23 11:47 AM
Location of Saved Message Being Compossed via Excel Send Worksheet dl270a Excel Discussion (Misc queries) 1 December 23rd 08 05:27 PM
Getting Excel to send message via Outlook 2000 manxshaun Excel Programming 2 November 8th 06 09:52 PM
send a outlook template message from excel [email protected] Excel Programming 1 July 9th 05 03:42 AM
Send a range in Excel as the body of an Outlook Express message Katie[_3_] Excel Programming 2 August 14th 04 12:50 PM


All times are GMT +1. The time now is 01:30 PM.

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

About Us

"It's about Microsoft Excel"