A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Copy contents of Excel range name to Email Subject line



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 6th 07, 02:06 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 20
Default Copy contents of Excel range name to Email Subject line

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?

Ads
  #2  
Old June 7th 07, 07:10 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy contents of Excel range name to Email Subject line



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 :

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?

  #3  
Old June 20th 07, 07:16 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 20
Default Copy contents of Excel range name to Email Subject line

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

On Jun 7, 1:10 am, "Michael Bauer [MVP - Outlook]"
wrote:
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 :



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?- Hide quoted text -


- Show quoted text -



  #4  
Old June 21st 07, 07:14 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy contents of Excel range name to Email Subject line



It is, of course. Then the intrinsic Application object refers to Outlook
and you'd write:

Dim Mail as Outlook.mailItem
set Mail=Application.CreateIem(olMailItem)

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 20 Jun 2007 10:16:43 -0700 schrieb :

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

On Jun 7, 1:10 am, "Michael Bauer [MVP - Outlook]"
wrote:
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 :



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?- Hide quoted text -


- Show quoted text -

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Email data inserted into subject line [email protected] Outlook - Using Forms 9 June 6th 07 10:49 PM
Change subject line in received email or saved email rburley Outlook Express 4 April 13th 07 02:49 PM
email addy with permanant subject line Leanin' Cedar Outlook - General Queries 1 December 27th 06 07:28 PM
Can I use the rules wizard to delete email with no subject line? SPJarvis70 Outlook - Installation 0 April 20th 06 09:55 PM
Change email subject line... silas Outlook Express 1 February 28th 06 12:59 AM


All times are GMT +1. The time now is 08:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.