View Single Post
  #2  
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




Ads