![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I have a VB6 program that is sending emails using the Outlook Object Library in Outlook 2003. It is all working fine except it always uses the Default User account to send the email. I can go in to outlook and change the default user then send the email, but I would rather automate this part. I am able to create the Outlook session and view the current user via the mOutlookApp.Session.CurrentUser, but it is only read only. Is there a way to change it? |
Ads |
#2
|
|||
|
|||
![]()
No, it's read-only. It wouldn't do any good even if you could, because it has
no bearing on how messages are sent. Can you provide more details? Are you trying to send from another Exchange mailbox? With through a different POP3/SMTP or IMAP4/SMTP account? Is Word the email editor? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Alan Cuthbertson" wrote: Hi, I have a VB6 program that is sending emails using the Outlook Object Library in Outlook 2003. It is all working fine except it always uses the Default User account to send the email. I can go in to outlook and change the default user then send the email, but I would rather automate this part. I am able to create the Outlook session and view the current user via the mOutlookApp.Session.CurrentUser, but it is only read only. Is there a way to change it? |
#3
|
|||
|
|||
![]() Hi Sue, I am using Outlook 2003, and they are Pop/SMTP accounts and I am using Word as the email editor. The bit of VB6 code I use is :- Dim mOutlookApp As Outlook.Application Dim mNameSpace As Outlook.NameSpace Dim mItem As MailItem Set mOutlookApp = CreateObject("Outlook.application") Set mNameSpace = mOutlookApp.GetNamespace("MAPI") MsgBox mOutlookApp.Session.CurrentUser Set mItem = mOutlookApp.CreateItem(olMailItem) mItem.Recipients.add "aaa@bbbb" mItem.Subject = "test" mItem.BodyFormat = olFormatHTML mItem.HTMLBody = "Message" mItem.Save mItem.Send "Sue Mosher [MVP-Outlook]" wrote: No, it's read-only. It wouldn't do any good even if you could, because it has no bearing on how messages are sent. Can you provide more details? Are you trying to send from another Exchange mailbox? With through a different POP3/SMTP or IMAP4/SMTP account? Is Word the email editor? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Alan Cuthbertson" wrote: Hi, I have a VB6 program that is sending emails using the Outlook Object Library in Outlook 2003. It is all working fine except it always uses the Default User account to send the email. I can go in to outlook and change the default user then send the email, but I would rather automate this part. I am able to create the Outlook session and view the current user via the mOutlookApp.Session.CurrentUser, but it is only read only. Is there a way to change it? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Query CurrentUser from Outlook View | [email protected] | Outlook and VBA | 3 | March 27th 08 10:07 PM |
namespace.CurrentUser - exactly where does this come from | KateG | Outlook and VBA | 3 | February 20th 08 08:26 PM |
Programmatically changing the message's sender field in MAPI. | JahMic | Add-ins for Outlook | 2 | August 15th 07 02:15 PM |
Programmatically changing settings in Outlook 2003 | Jonathan | Add-ins for Outlook | 1 | April 7th 06 08:49 PM |
capturing the currentuser... | Martin | Outlook and VBA | 7 | January 17th 06 11:56 AM |