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 / Outlook / Programming VBA / March 2006

Tip: Looking for answers? Try searching our database.

Paste cells from Excel into message body

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
goshute - 28 Mar 2006 20:49 GMT
How do I paste cells from Excel into a custom message form?  I do not
want to send an attachment.

I have everthing else worked out.

I would like to copy certain cells in Excel then paste into the body
after vSect1 and send the e-mail.

I have copied this from the macro recorder in Outlook but do not know
what to do with it if anything.

Selection.PasteExcelTable False, False, False
Selection.TypeParagraph

Here is the code I do have:

   Set objOutlook = CreateObject("Outlook.Application")
   Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   Set myNameSpace = objOutlook.GetNamespace("MAPI")
   Set myOutBox = myNameSpace.GetDefaultFolder(olFolderOutbox)

   With objOutlookMsg
       Set objOutlookRecip = .Recipients.Add(strName)
       objOutlookRecip.Type = olTo
       .Subject = "Test Sub"
       .Body = vSect1 & vbCrLf & vSect2
       .Save
       .Move myOutBox
   End With
Michael Bauer - 29 Mar 2006 06:02 GMT
Am 28 Mar 2006 11:49:56 -0800 schrieb goshute:

With the Outlook Object Model you can´t set the focus on the body window and
you can´t determine the cursor position.

The Redemption gives you all these possibilities. You can get it from
www.dimastr.com

Another workaround could be to write all the e-mail in Word. Save the
document then as HTML file, read the file content and write it into the
e-mails HTMLBody property.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 -- www.vbOffice.net --

> How do I paste cells from Excel into a custom message form?  I do not
> want to send an attachment.
[quoted text clipped - 25 lines]
>         .Move myOutBox
>     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.