Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Browsing for folders with email prefixes
guido1
Hi all
I'm wondering if there's a tidy way of permitting users to browse only for folders which are compatible with Ws communication server, ie. have an email address?
I've already implemented a solution using the IManBrowseCmd, and limiting the SelectableObjectTypes to objects of enum type imTypeDocumentFolder, however the parsing of the returned [folder] object (ie. whether or not it has an email prefix) has to take place after the browse dialog is terminated. I then have to redisplay the browse dialog
I guess I'm asking whether or not I can pass a different imObjectType enum value to the SelectableObjectTypes context item (eg. the non-existant imTypeEmailFolder constant), or whether there's a better way to test for this?
regards,
Guido
Find more posts tagged with
Comments
jny
Are you redisplaying only the document folders that have e-mail prefixes? If so, could you show me the code that is used to redisplay the browse dialog?
screenshot.1234962768.jpg
guido1
Ok - am including (sanitised version of) code used to instantiate browse dialog. Incidentally, could you shed any light on why I have to declare the sessions array as type NRTSession, and not the new IManSession? the latter seems incompatible when I pass it to a contextitems collection object
thanks in advance
Guido
======================
Dim sessions(0) As IManage.NRTSession
Dim browseCmd As IMANEXT2Lib.IManBrowseCmd
Dim contexts As IMANEXTLib.ContextItems
Dim selectableItems() As IManage.imObjectType
Dim selectedItems As Variant
Dim returnValue As Boolean
Set sessions(0) = Me.Session '[local property of type IManSession that initiates a new session]
ReDim selectableItems(0)
selectableItems(0) = imObjectType.imTypeDocumentFolder
Set browseCmd = New IMANEXT2Lib.IManBrowseCmd
Set contexts = New IMANEXTLib.ContextItems
With contexts
.Add "NRTDMS", Me.IWDMS '[local property of type ManDMS]
.Add "SelectedNRTSessions", sessions
.Add "ParentWindow", Me.hWnd '[local property of type int long that returns parent window handle]
.Add "IManExt2.BrowseCmd.SelectableObjectTypes", selectableItems
End With
With browseCmd
.Initialize contexts
.Update
.Execute
End With
returnValue = contexts.Item("IManExt.Refresh")
If returnValue = True Then
selectedItems = contexts.Item("IManExt2.BrowseCmd.SelectedObjects")
Set folderObject = selectedItems(0)
If folderObject.EmailPrefix = vbNullString Then
Debug.Print "folder doesn't have email prefix.. alert user and re-display browse dialog)
'...
End If
End If
sample.rptdesign
jny
You may only pass in a safe array of NRTSession Objects and not IManSession Objects because the IManExt2 source code cannot get the return value through the IDispatch Interface from IManSession as the IMan Interfaces currently do not support IDispatch.
I thought your code actually redisplays the browse dialog with only document folders that have e-mail prefixes, so I was curious to see how that happened, but I now saw that it was redisplaying the same folders for the end-user to reselect a folder that has an e-mail prefix.
Unfortunately, there isn't a mechanism through the SDK to display only those document folders that have e-mail prefixes. You may want to submit this as an enhancement request.
An alternative approach could be to use the IIntegrationDlg.BrowseFoldersDlg to catch the OnOK event to check for the existence of the folder's e-mail prefix, if not set the BrowseFoldersDlg.CloseOnOk to False, prompt user, and close the dialog only if the user has selected a folder that has an e-mail prefix.
guido1
thanks - i was really hoping to use the enhanced interface, rather than the BrowseFoldersDlg one.
is there any particular reason why IManBrowseCmd doesn't have a Dlg interface associated with it? I'm having to re-instantiate the command completely if the folder selected doesn't have an email, and it incurs a noticeable lag for the user
then again, I suppose that'll encourage them to pick the right folder in the first place..
jny
The ManBrowseDlg is associated with it.