Incorrect re-enable of folder form

Add-in Express™ Support Service
That's what is more important than anything else

Incorrect re-enable of folder form
 
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
Hi

I'm using the following code in order to show the folder form based on some criteria.
First time I see my form, but when I disable it and then re-enable it, I'm taking an empty pane.


  Private Sub adxOutlookEvents_ExplorerFolderSwitch(ByVal sender As Object, ByVal explorer As Object) Handles adxOutlookEvents.ExplorerFolderSwitch

    With Me.AdxOlFormsManager1
      If CType(explorer, Outlook.Explorer).CurrentFolder.Name.EndsWith("something") andalso ...<some other criteria>... Then
        .Items(0).Enabled = True
      Else
        .Items(0).Enabled = False
      End If
    End With
  End Sub


Is this a problem (like the one with inspector form I've already reported) or I'm doing something wrong?
Posted 25 Sep, 2006 11:36:42 Top
Fedor Shihantsov


Guest


Thanasis,

Use the AdxOlFormsManager.ADXFolderSwitch event

If CType(args.ExplorerObj, Outlook.Explorer).CurrentFolder.Name.EndsWith("something") andalso ...&lt;some other criteria&gt;... Then 
    args.ShowForm = True
Else
    args.ShowForm = True
End If


or the AdxOlFormsManager.ADXBeforeFolderSwitch event


Private Sub AdxOlFormsManager1_ADXBeforeFolderSwitch(
  ByVal explorerObj As System.Object, 
  ByVal SrcItem As AddinExpress.OL.ADXOlFormsCollectionItem, 
  ByVal SrcFolder As System.Object, 
  ByVal DstItem As AddinExpress.OL.ADXOlFormsCollectionItem, 
  ByVal DstFolder As System.Object) Handles AdxOlFormsManager1.ADXBeforeFolderSwitch
    AdxOlFormsManager1.LockUpdates()
    If CType(ExplorerObj, Outlook.Explorer).CurrentFolder.Name.EndsWith("something") andalso ...&lt;some other criteria&gt;... Then 
        AdxOlFormsManager1.Items(0).Enabled = True
    Else
        AdxOlFormsManager1.Items(0).Enabled = False
    End If
    AdxOlFormsManager1.UnlockUpdates()
End Sub
Posted 25 Sep, 2006 12:32:23 Top