A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Where is the bug ?



 
 
Thread Tools Search this Thread Display Modes
  #2  
Old June 8th 08, 07:23 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Where is the bug ?

The bug is in Outlook.
plugRedemption, on the other hand, will work correctly.And not not just in
Outlook 2007:

skPstAnsi = 1
skPstUnicode = 2
skPrimaryExchangeMailbox = 3
skDelegateExchangeMailbox = 4
skPublicFolders = 5
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Me.Application.Session.MAPIOBJECT
for each Store in Session.Stores
if (Store.StoreKind = skPstAnsi) or (Store.StoreKind = skPstUnicode) Then
Debug.Print Store.PstPath
ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) or (Store.StoreKind =
skDelegateExchangeMailbox) or (Store.StoreKind = skPublicFolders) Then
Debug.Print Store.ServerDN
End If
next

/plug

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"af2604" wrote in message
...
I'm trying to develop an addin for OutLook 2007 using Visual Studio 2008
Visual Basic.

In my outlook 2007 I have 2 accounts:

this is using the OUTLOOK.PST file
using : OUTLOOK.xxx.yyy.0000001.PST file

I'm trying this simple code :

ColStores = Me.Application.Session.Stores
Debug.Print("+---- start ----------------------------------------")
Debug.Print("| stores count =" + ColStores.Count.ToString)
Debug.Print("+---------------------------------------------------")
For i = 1 To ColStores.Count
FilePathName = ColStores(i).GetRootFolder.Store.FilePath
Debug.Print("| i =" + i.ToString + " " + FilePathName)
Next
Debug.Print("+---- end -------------------------------------------")

this is the output

+---- start ----------------------------------------
| stores count =2
+---------------------------------------------------
| i =1 C:\Documents and Settings\...\Microsoft\Outlook\Outlook.pst
| i =2
+---- end -------------------------------------------

FilePathName for i = 2 is set to nothing

the stores count : 2 is correct but why there is not the path and file
name of the PST file used by the IMAP account ?

Thanks a lot

Alberto



  #3  
Old June 9th 08, 12:53 PM posted to microsoft.public.outlook.program_addins
af2604
external usenet poster
 
Posts: 14
Default Where is the bug ?

Ok, thank you, is this the only solution ?

Dmitry Streblechenko ha scritto:
The bug is in Outlook.
plugRedemption, on the other hand, will work correctly.And not not just in
Outlook 2007:

skPstAnsi = 1
skPstUnicode = 2
skPrimaryExchangeMailbox = 3
skDelegateExchangeMailbox = 4
skPublicFolders = 5
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Me.Application.Session.MAPIOBJECT
for each Store in Session.Stores
if (Store.StoreKind = skPstAnsi) or (Store.StoreKind = skPstUnicode) Then
Debug.Print Store.PstPath
ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) or (Store.StoreKind =
skDelegateExchangeMailbox) or (Store.StoreKind = skPublicFolders) Then
Debug.Print Store.ServerDN
End If
next

/plug

  #4  
Old June 9th 08, 06:40 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Where is the bug ?

You could also use Extedned MAPI in C++ or Delphi to read the path from the
profile data section.
Note that the full path to the PST file is embedded in the store entry id
(in OutlookSpy, click go to an IMAP store, click IMsgStore, select
PR_STORE_ENTRYID property, click the button next to the Value edit box). You
could hack it, but the entry id format is not documented and is subject to
change in any version.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"af2604" wrote in message
...
Ok, thank you, is this the only solution ?

Dmitry Streblechenko ha scritto:
The bug is in Outlook.
plugRedemption, on the other hand, will work correctly.And not not just
in Outlook 2007:

skPstAnsi = 1
skPstUnicode = 2
skPrimaryExchangeMailbox = 3
skDelegateExchangeMailbox = 4
skPublicFolders = 5
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Me.Application.Session.MAPIOBJECT
for each Store in Session.Stores
if (Store.StoreKind = skPstAnsi) or (Store.StoreKind = skPstUnicode)
Then
Debug.Print Store.PstPath
ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) or (Store.StoreKind
= skDelegateExchangeMailbox) or (Store.StoreKind = skPublicFolders) Then
Debug.Print Store.ServerDN
End If
next

/plug



  #5  
Old June 9th 08, 09:18 PM posted to microsoft.public.outlook.program_addins
af2604
external usenet poster
 
Posts: 14
Default Where is the bug ?

Dmitry Streblechenko ha scritto:
..... You
could hack it, but the entry id format is not documented and is subject to
change in any version.


Thank you very very much... this is simply GREAT
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.