Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Body Text difficulty when Excel launches Outlook Message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ajaypondicherry@gmail.com - 24 Jan 2007 00:35 GMT
I need to generate an email from excel which contains excel data in an
outlook mail message. I cannot find a way to insert more text after the
original body text (much like the insert.after.text command when
launching a MS Word document). I would like to have a loop which
inserts more text into the message body, but the .body command will
replace all existing text.

Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
'This will make the user enter the CID if it is not already entered
If Sheet1.Cells(2, 1) = 0 Or Sheet1.Cells(2, 1) = "" Then
Sheet1.Cells(2, 1) = InputBox("Please enter the CID")
End If
'This creates the email and fills out all fields
With objMail
   .To = "bad-inventory-request@shopzilla.com"
   .Subject = "CHOMPS Request for " & Sheet1.Cells(2, 2) & " (" &
Sheet1.Cells(2, 1) & ")"
   .Body = "CHOMPS Request Form" & Chr(11) & Chr(11) & "*Category: " &
Sheet1.Cells(2, 2) & " (" & Sheet1.Cells(2, 1) & ")" & Chr(11) &
Chr(11) & "*Items to Move: " & Chr(11) & Chr(11) & "*Does Taxonomy need
to be changed?" & Chr(11) & Chr(11) & "New Category Locations for all
items:" & Chr(11) & Chr(11) & "Additional Keywords (if any):" & Chr(11)
& Chr(11) & "Additional Notes (if any): " & Chr(11) & Chr(11) &
"*Required Information"

   .Display
End With
Perry - 24 Jan 2007 02:20 GMT
Have you tried to catch the entire body text in a variable *before* passing
it to the mailitem .Body property ??
Like (simplified)

sBody = "some huge huge huge text " & Chr(13) & Chr(11) & "...etc."

With objMail
   .Body = sBody
   .Display
End With

Krgrds,
Perry

>I need to generate an email from excel which contains excel data in an
> outlook mail message. I cannot find a way to insert more text after the

> original body text (much like the insert.after.text command when
> launching a MS Word document). I would like to have a loop which
[quoted text clipped - 22 lines]
>    .Display
> End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.