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)
Confused about which function to use to open a file
Azan
I am a newbie and am trying to open a document in worksite 8 using the non enhanced dialog but am confused about which function and which dll to use.
I am able to bring up the enhanced open file dialog by using iManExt2Lib.IManFileOpenCmd but what I want to use is the old explorer type dialog.
Through some testing with Word and Acrobat (in a Worksite 8 environment) I found that when the following key HKEY_LOCAL_MACHINE\Software\Interwoven\WorkSite\8.0\Integration\
Options was set to 0, when you clicked the open file button it would bring up the old style open file dialog window. This is the window that I am trying to utilise in my application. This also appears to be the same dialog that is used if you click the open file button in Word or Acrobat in a Worksite 6 environment
I have tried using iManExtLib.BrowseFoldersCmd but am getting an exception - "AltAdvise Failed"
I am not sure what I am doing wrong. Is this even the right function (iManExtLib.BrowseFoldersCmd) to call to get the screen that I want. Can anyone please help?
Below is the code I have been trying to run
Dim pBrowseCmd As iManExtLib.BrowseFoldersCmd
Dim window As Form = CType(windowObj, Form)
Dim pContextitems As iManExtLib.ContextItems
pContextitems = New iManExtLib.ContextItems
pContextitems.Add("ParentWindow", window)
pContextitems.Add("NRTDMS", _NRTDMS)
pContextitems.Add("SelectedNRTSessions", New iManage.NRTSession() {_NRTSession})
pBrowseCmd = New iManExtLib.BrowseFoldersCmd
pBrowseCmd.Initialize(pContextitems)
pBrowseCmd.Update()
If pBrowseCmd.Status = iManExtLib.CommandStatus.nrActiveCommand Then
pBrowseCmd.Execute()
End If
Find more posts tagged with
Comments
jny
If you want to use the open dialog in Classic Mode, i.e:
[HKEY_LOCAL_MACHINE\SOFTWARE\Interwoven\WorkSite\8.0\Integration\Options]
"EnhancedApplicationIntegrationOpen"=dword:00000000
You would need to invoke an instance of the DocOpenDlg Object. The usage of this Object is documented in the Using WorkSite Dialog.pdf, specifically under 'Browse For Folders Dialog' which is distributed with the WorkSite iToolkit 8.x.
[VB] 'Reference IIntegrationDlg.dll
Dim MyDialog As IIntegrationDlg.DocOpenDlg
Dim dms As New IManage.NRTDMS
Dim sess As IManage.NRTSession
Dim commands(1 To 4) As String
Dim lCommandSelected As Long
Dim DocArray As Variant
Dim hHandle As Long
Set sess = dms.Sessions.Add("MYSERVER")
'sess.Login "", ""
sess.TrustedLogin
'pHandle is the parent window handle
Set MyDialog = New IIntegrationDlg.DocOpenDlg
'Set hHandle equal to the parent window handle
hHandle = MyDialog.Window
'Define the commands that should appear on the
'action Menu
commands(1) = "
@1@&
;MyOpen "
commands(2) = "
@2@Open
&Copy"
commands(3) = "
@3@&
;View"
commands(4) = "
@4@&
;Properties"
Dim sdefloc As String
Dim sessID As String
Dim dbID As String
Dim fldrID As String
Dim fldr As NRTFolder
Dim db As NRTDatabase
sessID = sess.ID
Set db = sess.PreferredDatabase
'Set properties on dialog object
With MyDialog
.NRTDMS = dms
.SingleSel = False ' Enable selecting more than one document
.CommandList = commands
.Show hHandle
End With
'Determine the action selected by the user
'Value is ñ1 when Cancel is selected
lCommandSelected = MyDialog.CommandSelected
If lCommandSelected = -1 Then GoTo Cleanup
'Put the array of NRTDocument objects
' selected by the user in DocArray
DocArray = MyDialog.DocumentList
Dim doc As IManage.NRTDocument
Dim i, ct As Long
ct = UBound(DocArray) - LBound(DocArray)
For i = 0 To ct
Set doc = DocArray(i)
' "3" represents the action button to view doc
If lCommandSelected = 3 Then
Dim objViewCmd As IMANEXTLib.ViewCmd
Dim collContext As IMANEXTLib.ContextItems
Dim arrDox(0) As IManage.NRTDocument
Set objViewCmd = New IMANEXTLib.ViewCmd
Set collContext = New IMANEXTLib.ContextItems
Set arrDox(0) = doc
' Set required contextitems
collContext.Add "ParentWindow", FrmOD.hWnd
collContext.Add "SelectedNRTDocuments", arrDox
' Initialize command
objViewCmd.Initialize collContext
' Update command
objViewCmd.Update
' Execute if Active
If objViewCmd.Status = (objViewCmd.Status And nrActiveCommand) Then
objViewCmd.Execute
End If
End If
Next i
GoTo Cleanup
Cleanup:
' Free pointers before exiting
Set objViewCmd = Nothing
Set collContext = Nothing
Set MyDialog = Nothing
Set sess = Nothing
Set dms = Nothing
Set doc = Nothing