View Single Post
  #1  
Old October 29th 07, 10:31 PM posted to microsoft.public.outlook.program_addins
jochen[_2_]
external usenet poster
 
Posts: 2
Default Outlook 2003 VB6 Add-In: Loop folders in AddinInstance_OnConnectio

Hello out there,

my first VB6-add-in for Outlook 2003 does not work on all machines. If other
add-ins are loaded, it sometimes failes with an error "Client process could
not be completed".
The error occurs when in AddinInstance_OnConnection my add-in looks for a
certain folder.

Dim oStores As Outlook.Folders
Dim oFolder As Outlook.MAPIFolder
Dim oSubFolder As Outlook.MAPIFolder
Dim sMyEntryID As String

Set oStores = oMyOLNameSpace.Folders
For Each oFolder In oStores
For Each oSubFolder In oFolder.Folders
If oSubFolder.Name = "NeedThis" Then
sMyEntryID = oSubFolder.EntryID
End If
Next oSubFolder
Next oFolder

Is there anything wrong with looping through Outlook folders in
AddinInstance_OnConnection? Is this bad practice?
Thanks for your advice!
Jochen

Ads