specify "From" field

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

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
 
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
 
it actually worked. sorry for confusion

Greg said:
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
 
Back
Top