![]() |
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
|
|||
|
|||
![]()
Q1: In OnConnection function, the follow code can work. I'm using outlook2003.
Outlook::MAPIFolderPtr pSentFd = m_NSPtr-GetDefaultFolder(Outlook:: olFolderSentMail); pSentFdItems = pSentFd-GetItems(); ItemsItemAddEvent: ![]() But following couldn't, why? m_NSPtr-GetFolders(); then loop to search the specified folder, i'm sure i found the correct folder, then if(HotPtr != NULL)//HotPtr is the correct MAPIFolderPtr for olFolderSentMail. { CComPtrOutlook::_Items HotInboxItems = HotPtr-GetItems(); long ll = HotInboxItems-GetCount(); ItemsItemAddEvent: ![]() } But the event could not be fired. Q2: How could i get MailItem of the mail receive from HTTP hotmail? I don't know how to DispEventAdvise on hotmail's message store(I add a HTTP account which is MS's hotmail), i use the code above to set event on the folder of hotmail(and i'm sure the folder is correct folder), but couldn't work. Is there a way to get hotmail's(INTERSTOR) "Namespace" so that i can get its folder to set the current advise? In a word, i want to get the MailItem of HTTP mail from hotmail to process, is that clear? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
Ads |
#2
|
|||
|
|||
![]()
1. The object raising the events (HotInboxItems) must be alive at all times.
Make sit a global/cklass variable rather than a local one. 2. There is nothing special about the Hotmail store (which is really a PST store). -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:945fd1e51fdd8@uwe... Q1: In OnConnection function, the follow code can work. I'm using outlook2003. Outlook::MAPIFolderPtr pSentFd = m_NSPtr-GetDefaultFolder(Outlook:: olFolderSentMail); pSentFdItems = pSentFd-GetItems(); ItemsItemAddEvent: ![]() But following couldn't, why? m_NSPtr-GetFolders(); then loop to search the specified folder, i'm sure i found the correct folder, then if(HotPtr != NULL)//HotPtr is the correct MAPIFolderPtr for olFolderSentMail. { CComPtrOutlook::_Items HotInboxItems = HotPtr-GetItems(); long ll = HotInboxItems-GetCount(); ItemsItemAddEvent: ![]() } But the event could not be fired. Q2: How could i get MailItem of the mail receive from HTTP hotmail? I don't know how to DispEventAdvise on hotmail's message store(I add a HTTP account which is MS's hotmail), i use the code above to set event on the folder of hotmail(and i'm sure the folder is correct folder), but couldn't work. Is there a way to get hotmail's(INTERSTOR) "Namespace" so that i can get its folder to set the current advise? In a word, i want to get the MailItem of HTTP mail from hotmail to process, is that clear? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
#3
|
|||
|
|||
![]()
Yes, that's right, i change the object to a member of class, it is ok. Thanks
in advance. ^_^ But here is another question, in my test code, i assume that the MsgStore's name is "hotmail", but in fact the name can be not "hotmail". What's the better way to get the correct entry id of inbox?(not default MsgStore). Dmitry Streblechenko wrote: 1. The object raising the events (HotInboxItems) must be alive at all times. Make sit a global/cklass variable rather than a local one. 2. There is nothing special about the Hotmail store (which is really a PST store). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
#4
|
|||
|
|||
![]()
2. I don't think there is anything you can do if you are using the Outlook
Object Model alone. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:94638267fd003@uwe... Yes, that's right, i change the object to a member of class, it is ok. Thanks in advance. ^_^ But here is another question, in my test code, i assume that the MsgStore's name is "hotmail", but in fact the name can be not "hotmail". What's the better way to get the correct entry id of inbox?(not default MsgStore). Dmitry Streblechenko wrote: 1. The object raising the events (HotInboxItems) must be alive at all times. Make sit a global/cklass variable rather than a local one. 2. There is nothing special about the Hotmail store (which is really a PST store). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
#5
|
|||
|
|||
![]()
Hi, Dmitry, thank you for your reply.
I am now try to use MAPI for this problem, and have a small question. Assume the default profile name's "MyProfile". These are what i did: 1.IProfAdmin::AdminServices to get ServiceAdmin 2.IMsgServiceAdmin::GetMsgServiceTable to get table 3.IMAPITable::QueryRows to get all message store rows. 4.for loop to find property of PR_SERVICE_NAME_A use PpropFindProp. If find check if it is "INTERSTOR", if it is "INTERSTOR", check the "" propery, but the second check is failed, can you help me out with it? This is the code snippet: for(ULONG uLoop = 0; uLoop pStoreRows-cRows; uLoop ++) { lpCurProp = pStoreRows-aRow[uLoop].lpProps; uCurValue = pStoreRows-aRow[uLoop].cValues; lpRetStoreProp = PpropFindProp( lpCurProp, uCurValue, PR_SERVICE_NAME_A ) ; if (_CheckStringProp(lpRetStoreProp, PT_STRING8)) { // compare the string with "INTERSTOR" CString szServiceName(lpRetStoreProp-Value.lpszA); if(!szServiceName.CompareNoCase("INTERSTOR")) { lpCurProp = pStoreRows-aRow[uLoop].lpProps; uCurValue = pStoreRows-aRow[uLoop].cValues; // get the message provider UID lpRetStoreProp = PpropFindProp( lpCurProp, uCurValue, PR_PROVIDER_UID ); if(lpRetStoreProp && PR_PROVIDER_UID == lpRetStoreProp-ulPropTag) {// Here failed, what's going on? } } } } I'm sure that PR_PROVIDER_UID is the exist property. Thanks in advance. Dmitry Streblechenko wrote: 2. I don't think there is anything you can do if you are using the Outlook Object Model alone. Yes, that's right, i change the object to a member of class, it is ok. Thanks [quoted text clipped - 9 lines] 2. There is nothing special about the Hotmail store (which is really a PST store). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
#6
|
|||
|
|||
![]()
Why exactly does the check fail?
What do you see in OutlookSpy when you click IMAPISession::AdminServices -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "ryotyankou via OfficeKB.com" u48591@uwe wrote in message news:9495c05312ffe@uwe... Hi, Dmitry, thank you for your reply. I am now try to use MAPI for this problem, and have a small question. Assume the default profile name's "MyProfile". These are what i did: 1.IProfAdmin::AdminServices to get ServiceAdmin 2.IMsgServiceAdmin::GetMsgServiceTable to get table 3.IMAPITable::QueryRows to get all message store rows. 4.for loop to find property of PR_SERVICE_NAME_A use PpropFindProp. If find check if it is "INTERSTOR", if it is "INTERSTOR", check the "" propery, but the second check is failed, can you help me out with it? This is the code snippet: for(ULONG uLoop = 0; uLoop pStoreRows-cRows; uLoop ++) { lpCurProp = pStoreRows-aRow[uLoop].lpProps; uCurValue = pStoreRows-aRow[uLoop].cValues; lpRetStoreProp = PpropFindProp( lpCurProp, uCurValue, PR_SERVICE_NAME_A ) ; if (_CheckStringProp(lpRetStoreProp, PT_STRING8)) { // compare the string with "INTERSTOR" CString szServiceName(lpRetStoreProp-Value.lpszA); if(!szServiceName.CompareNoCase("INTERSTOR")) { lpCurProp = pStoreRows-aRow[uLoop].lpProps; uCurValue = pStoreRows-aRow[uLoop].cValues; // get the message provider UID lpRetStoreProp = PpropFindProp( lpCurProp, uCurValue, PR_PROVIDER_UID ); if(lpRetStoreProp && PR_PROVIDER_UID == lpRetStoreProp-ulPropTag) {// Here failed, what's going on? } } } } I'm sure that PR_PROVIDER_UID is the exist property. Thanks in advance. Dmitry Streblechenko wrote: 2. I don't think there is anything you can do if you are using the Outlook Object Model alone. Yes, that's right, i change the object to a member of class, it is ok. Thanks [quoted text clipped - 9 lines] 2. There is nothing special about the Hotmail store (which is really a PST store). -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/200904/1 |
#7
|
|||
|
|||
![]()
I solved it, After check the terms with outlookspy, my mind's clear and then
the problem were sloved, thank again, Dmitry. Dmitry Streblechenko wrote: Why exactly does the check fail? What do you see in OutlookSpy when you click IMAPISession::AdminServices Hi, Dmitry, thank you for your reply. I am now try to use MAPI for this problem, and have a small question. [quoted text clipped - 44 lines] PST store). -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Greek Fonts Dont work in Office but work in Windows | George | Outlook - Using Contacts | 0 | May 16th 07 10:33 PM |
How to set up 3 days at work 3 days off work repeating? | Glenn Tricarico | Outlook - Calandaring | 2 | February 12th 07 11:57 PM |
How do I customize my work week if I work different hours daily? | Pratherer | Outlook - Calandaring | 1 | October 31st 06 05:57 AM |
e-mail alerts don't work,setup but don't work- | Studmn1 | Outlook - General Queries | 3 | August 24th 06 09:38 PM |
Getting no Events ! - IDispEventSimpleImpl , DispEventAdvise | davidb | Add-ins for Outlook | 3 | June 13th 06 08:31 AM |