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

specify "From" field



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 28th 08, 10:24 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default specify "From" field

hi,

Using Outlook 2003.

I have access to a shared mail box with the ability to send emails either
from either my account or shared account without logging off. There is a
“From…” field above “To…” field.

I'm trying to incorporate this functionality into the code, but unable to
find a MailItem.From in the object library similar to .To or .CC for example

Is there a way to specify it?

Thank you
______
Regards,
Greg
Ads
  #2  
Old May 29th 08, 05:26 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default specify "From" field

MailItem.SentOnBehalfOfName

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Greg" wrote in message
...
hi,

Using Outlook 2003.

I have access to a shared mail box with the ability to send emails either
from either my account or shared account without logging off. There is a
"From:" field above "To:" field.

I'm trying to incorporate this functionality into the code, but unable to
find a MailItem.From in the object library similar to .To or .CC for
example

Is there a way to specify it?

Thank you
______
Regards,
Greg



  #3  
Old May 29th 08, 08:18 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default specify "From" field

Dimon,

Does not work...
here is my code (in excel). Everything else is populated
Thanks!
=============
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next


With OutMail
.SentOnBehalfOfName = strFrom
.To = strTo
.CC = strCC
.BCC = ""
.Subject = strSubj
.HTMLBody = RangetoHTML(rng)
.display 'or use .Send
End With
On Error GoTo 0


--
______
Regards,
Greg


"Dmitry Streblechenko" wrote:

MailItem.SentOnBehalfOfName

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Greg" wrote in message
...
hi,

Using Outlook 2003.

I have access to a shared mail box with the ability to send emails either
from either my account or shared account without logging off. There is a
"From:" field above "To:" field.

I'm trying to incorporate this functionality into the code, but unable to
find a MailItem.From in the object library similar to .To or .CC for
example

Is there a way to specify it?

Thank you
______
Regards,
Greg




  #4  
Old May 30th 08, 05:51 PM posted to microsoft.public.outlook.program_vba
greg
external usenet poster
 
Posts: 91
Default specify "From" field

it actually worked. sorry for confusion

"Greg" wrote:

Dimon,

Does not work...
here is my code (in excel). Everything else is populated
Thanks!
=============
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next


With OutMail
.SentOnBehalfOfName = strFrom
.To = strTo
.CC = strCC
.BCC = ""
.Subject = strSubj
.HTMLBody = RangetoHTML(rng)
.display 'or use .Send
End With
On Error GoTo 0


--
______
Regards,
Greg


"Dmitry Streblechenko" wrote:

MailItem.SentOnBehalfOfName

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Greg" wrote in message
...
hi,

Using Outlook 2003.

I have access to a shared mail box with the ability to send emails either
from either my account or shared account without logging off. There is a
"From:" field above "To:" field.

I'm trying to incorporate this functionality into the code, but unable to
find a MailItem.From in the object library similar to .To or .CC for
example

Is there a way to specify it?

Thank you
______
Regards,
Greg




 




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
"Add Field" button under "Customized Form" stop working??? Troika Outlook - Using Forms 1 March 4th 08 01:17 AM
How to set holidays as "Out of office" in "Show time as" field? TFS Outlook - Calandaring 0 May 22nd 06 03:40 PM
DO NOT include field "Title" in the name column in "To" search Rob G. Outlook - Using Contacts 7 May 3rd 06 08:47 PM
Removing unwanted "Auto Complete" addresses from the "To:" field? Pilgrim Outlook - General Queries 1 May 1st 06 07:15 PM
"Percent" field changed to "Number" field Vaughan Outlook - Using Forms 1 March 14th 06 01:32 PM


All times are GMT +1. The time now is 07:58 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.