Dear Future Friends,
I am writing some code to let one pick a document from worksite and then attach it to an email - but in a way our users prefer rather than the standard function. The target environment is Lotus Notes( by the way the code works exactly the same way in Lotus Notes) - but I have written it in VBA for Excel because it is easier to debug at this time, and I thought it might be easier to get help.
I am having 2 problems -
1) the DocOpenDlg is showing the "Classic" version of document search and my manager would prefer the other more "Modern" look.
2) setting default location ( I would like to set it to worklist ) doesn't seem to work.
Private Sub Worksheet_Activate()
Dim ContextItems As New IMANEXTLib.ContextItems
Dim dms As New ManDMS
Dim sess As IManSession
Dim pNRTDocs As IManage.NRTDocuments
Dim pSearcArgs As IManage.IManProfileSearchParameters
Dim pSearchArg As IManage.IManProfileSearchParameter
Dim lCommandSelected As Long
Dim DocArray As Variant
Set sess = dms.Sessions.Add("EUROPE")
Call sess.TrustedLogin
Call ContextItems.Add("ParentWindow", Me)
Call ContextItems.Add("SelectedIManSession", sess)
Call ContextItems.Add("NRTDMS", dms)
Call ContextItems.Add("SearchDatabaseName", "EUROPE")
Dim OpenDocDlg As New IIntegrationDlg.DocOpenDlg
OpenDocDlg.Caption = "Please select to document you would like to attach to your email"
OpenDocDlg.NRTDMS = dms
OpenDocDlg.SingleSel = True
OpenDocDlg.CloseOnOK = False
Dim commands(1 To 1) As String
commands(1) = "
@1@&Attach to Email "
OpenDocDlg.CommandList = commands
Dim sLoc As String
sLoc = "\" & sess.WorkArea.worklist.ObjectID
OpenDocDlg.DefaultLocation = sLoc
OpenDocDlg.Show (OpenDocDlg.Window())
lCommandSelected = OpenDocDlg.CommandSelected
'Set DocArray equal to the array of NRTDocument
'objects selected by the user
DocArray = OpenDocDlg.DocumentList
-- this is where I would be putting my code to attach documents to email using GetCopy
'Clean up
Set OpenDocDlg = Nothing
End Sub