View Single Post
  #2  
Old October 30th 07, 06:40 AM posted to microsoft.public.outlook.program_addins
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook 2003 VB6 Add-In: Loop folders in AddinInstance_OnConnectio



How dows the complete procedure look like?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Mon, 29 Oct 2007 14:31:00 -0700 schrieb jochen:

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