![]() |
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
|
|||
|
|||
![]()
I'm using VC++2005 and ATL to develop a outlook addin. I have two problems:
1. I want to get the sender name of CurrentItem when send mail(outlookspy). I searched a lot on the internet. Finally i use the MAPI to get it, it is ok, but the receiver can't open the message(encrypted). What i do is that MailItem-Save, then getprops InetAcct_GUID = { 0x00062008, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };id = 0x8581; I don't know the reason. How could i get the sender string? 2. How could i set the account to send email in background? Say i have two accounts A and B, A is the default account, when C send a mail to B, I want to use B automatically reply a message to C. But the default account is A, how could i use B to send it? Any tips or advices will be good, thx. |
Ads |
#2
|
|||
|
|||
![]()
After search the other forum, i found a way to fix my first problem, i will
try it(I almost known nothing to VB). --------------------------- Sue Mosher 02-Sep-2004 07:51 Gudbrandur, you detect the sending account for a message by using CommandBars techniques to look at what account is selected on the user's toolbar. See http://www.outlookcode.com/d/tips/commandbarfun.htm -------------------------------- This post is too old, posted at 2004. Are there some other ways to fix my first problem? I'm using outlook2003 and 2007. Thx. |
#3
|
|||
|
|||
![]()
My first problem is fixed, save the item, the getprops, it is ok. The error i
said before is caused by other reason. Then, how about my second problem? Thx very much. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#4
|
|||
|
|||
![]()
UseMailItem.SendUsingAccount property (Outlook 2007 specific).
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:8fc5a50ffeeda@uwe... My first problem is fixed, save the item, the getprops, it is ok. The error i said before is caused by other reason. Then, how about my second problem? Thx very much. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#5
|
|||
|
|||
![]()
Thank you Dmitry, but how about outlook2003, the main task of our product
should be implemented on 2003 not 2007.(I known outlook2007 have some new interfaces and structruces can do the job easily). Dmitry Streblechenko wrote: UseMailItem.SendUsingAccount property (Outlook 2007 specific). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#6
|
|||
|
|||
![]()
You can set these properties using Extended MAPI (shouldn't be a problem if
you are using C++) - IMessage interface can be obtained through the MailItem.MAPIOBJECT property. To retrieve the accoutn naame and id, use the IOlkAccountManager interface. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:8fd0a5122dad4@uwe... Thank you Dmitry, but how about outlook2003, the main task of our product should be implemented on 2003 not 2007.(I known outlook2007 have some new interfaces and structruces can do the job easily). Dmitry Streblechenko wrote: UseMailItem.SendUsingAccount property (Outlook 2007 specific). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#7
|
|||
|
|||
![]()
That's great, i will try it tommorrow. How can i use this interface to set
the account to send email? I find a sample on codeproject.com. It can retrieve all accounts, but how to set the default account, the SetOrder() function? But how could i know which one is the current default account? Thanks very much. Dmitry Streblechenko wrote: You can set these properties using Extended MAPI (shouldn't be a problem if you are using C++) - IMessage interface can be obtained through the MailItem.MAPIOBJECT property. To retrieve the accoutn naame and id, use the IOlkAccountManager interface. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#8
|
|||
|
|||
![]()
The first account in the list returned by IOlkAccountManager::GetOrder
method is teh default one. You can play with IOlkAccountManager in OutlookSpy - click Misc | IOlkAccountManager. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:8fdf87823e701@uwe... That's great, i will try it tommorrow. How can i use this interface to set the account to send email? I find a sample on codeproject.com. It can retrieve all accounts, but how to set the default account, the SetOrder() function? But how could i know which one is the current default account? Thanks very much. Dmitry Streblechenko wrote: You can set these properties using Extended MAPI (shouldn't be a problem if you are using C++) - IMessage interface can be obtained through the MailItem.MAPIOBJECT property. To retrieve the accoutn naame and id, use the IOlkAccountManager interface. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#9
|
|||
|
|||
![]()
Thank you Dmitry, the IOlkAccountManager can Set the default account, but i
still have question here. Say A is the default account, B is another, and C send a message to B. B should auto reply a message to C. This is my code flow for repy message to C: 1. Set specified account(B) as default.(SetOrder) 2. Create the message and send it. 3. Restore the original account(A).(SetOrder again) well, the problem is that How could i known when the message is already sent. The result of my code is alway send by A. If i mark the 3. It can work(send by B). But it is bad for that change the default account and user may don't know that, right? In one word, when should i do the action 3? Thanks in advance. Dmitry Streblechenko wrote: The first account in the list returned by IOlkAccountManager::GetOrder method is teh default one. You can play with IOlkAccountManager in OutlookSpy - click Misc | IOlkAccountManager. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
#10
|
|||
|
|||
![]()
Do not reset the default account, simply set the appropriate named
properties on the message to tell Outlook which account it should use for sending. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:8feb53939ec5d@uwe... Thank you Dmitry, the IOlkAccountManager can Set the default account, but i still have question here. Say A is the default account, B is another, and C send a message to B. B should auto reply a message to C. This is my code flow for repy message to C: 1. Set specified account(B) as default.(SetOrder) 2. Create the message and send it. 3. Restore the original account(A).(SetOrder again) well, the problem is that How could i known when the message is already sent. The result of my code is alway send by A. If i mark the 3. It can work(send by B). But it is bad for that change the default account and user may don't know that, right? In one word, when should i do the action 3? Thanks in advance. Dmitry Streblechenko wrote: The first account in the list returned by IOlkAccountManager::GetOrder method is teh default one. You can play with IOlkAccountManager in OutlookSpy - click Misc | IOlkAccountManager. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200901/1 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Block Sender List Problems | LVM | Outlook Express | 2 | June 25th 07 03:18 PM |
Sender = Recipient | Jon | Outlook Express | 4 | June 18th 06 11:15 PM |
PlanPlus v 3 (and Outlook 2003 SP2) - install problems, uninstall problems, bugs? | kkernspa | Add-ins for Outlook | 0 | April 9th 06 03:07 AM |
can i group emails by sender & by number of items for each sender | baffled_by_tech | Outlook - Using Contacts | 2 | March 5th 06 08:27 PM |
Junk mail: How to create a button for "Add sender to blocked sender list" | Nananana | Outlook - General Queries | 2 | February 2nd 06 12:37 PM |