Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / May 2008

Tip: Looking for answers? Try searching our database.

specify "From" field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 28 May 2008 22:24 GMT
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
Dmitry Streblechenko - 29 May 2008 05:26 GMT
MailItem.SentOnBehalfOfName

Signature

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-

> hi,
>
[quoted text clipped - 14 lines]
> Regards,
> Greg
Greg - 29 May 2008 20:18 GMT
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

Signature

______
Regards,
Greg

> MailItem.SentOnBehalfOfName
>
[quoted text clipped - 16 lines]
> > Regards,
> > Greg
Greg - 30 May 2008 17:51 GMT
it actually worked. sorry for confusion

> Dimon,
>
[quoted text clipped - 44 lines]
> > > Regards,
> > > Greg
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.