Excel and Outlook --- plz help!

ralfp

New Member
Joined
Aug 18, 2010
Messages
17
Hello,
I am trying to create a spreadsheet that I can use to input some data and then create emails to different destinataries with different arays of data.

so far i got this far:
I need to be able to create outlook emails from a spreadsheet.

Sub Test()
Dim olApp As Object, olMail As Object

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.To = "Anyone@anywhere.com"
olMail.Body = Range("a1")

olMail.Display

AppActivate "Microsoft Excel"

End Sub


I got a couple issues:
1) how do i select more than 1 email address?
2)how do i select a wider range? I need to select a3:d21, but having issues doing so.

I would really apprecitae some help regarding this matter.

thanks!

AP
 
Thanks for your help Jen.

I think i need to insert breaks and lines as u said. Let say this is the info I got in the spreadsheet:

Buyer: Ginpac
Trader´s Name: Ralf Soto
Seller: Impec
Trader´s Name: Hans Trauter
Crude Type: Oman
Quantity: 750,000 bbls +/- 10% at Seller's option.
Price: Dated +*5,02 usd/bl. *
Delivery Terms: DES, B/L figures for invoicing.
Delivery Location: Honolulu, Hawai

Buyer is A3, Honolulu Hawai is B9.

I want to be able to copy all that info into the email with the proper spacing.

Is this something you know how to do?

Thanks again for your help
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
without knowing what is in each specific cell, the general idea is


olMail.Body = Range(cell).value & vbtab (tab) & Range(next cell on first line).value _
& vbnewline (line break) & range(first cell on next line).value </pre>
 
Upvote 0
Hi , I'm back on line.
I think you'll have to do a copy and paste for the correct text to appear in the body.
Try naming the range and then do a copy of the named range. then follow with a paste special into the body of the E-Mail.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top