Copy contents of Excel range name to Email Subject line

E

excel

I've written a few Macros in Excel, but never Outlook. I don't see a
macro recorder. All I'm trying to do is copy a range name from
timesheet.xls and put it in the subject line of an email I'm
composing. Can this be done? How?
 
M

Michael Bauer [MVP - Outlook]

If the code is in Excel and Outlook is already running:

Dim olApp as Outlook.Application
Dim Mail as Outlook.mailItem

set olApp=getObject(,"Outlook.Application")
set Mail=olApp.CreateIem(olMailItem)

Mail.Subject=YourRange.Name

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 06 Jun 2007 05:06:56 -0700 schrieb (e-mail address removed):
 
E

excel

Is it possible to write the code in Outlook instead? For example,
you've already written teh email and are just trying to add a subject
line.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top