我正在尝试使用 IMANEXTLib 中的 ImportCmd 将 Word 文档保存到 iManage 中,并且每次运行它时都会获得一个新的 Word 实例。
我已将文档保存到 doc1.doc,然后:
'Connects to WorkSite
Dim dmsConnection As IManage.IManDMS = New IManage.ManDMSClass()
dmsConnection.ApplicationName = "My Application"
Dim sesCobbDms As IManage.IManSession = dmsConnection.Sessions.Add("DMS")
sesCobbDms.TrustedLogin()
'Initialisation
Dim hwndWord As Integer
Dim strTempCaption As String = Application.Caption
Application.Caption = "Hunting For Word"
hwndWord = MyApi.FindWindow("OpusApp", Application.Caption)
Application.Caption = strTempCaption
Dim intKeepCheckedOut As Integer
Dim docJustSaved As IManage.NRTDocument
Dim objImportCmd As IMANEXTLib.ImportCmd
Dim objContextItems As New IMANEXTLib.ContextItems
'Sets up ContextItems ready for save process
objContextItems.Add("ParentWindow", hwndWord)
objContextItems.Add("DestinationObject", sesCobbDms)
objContextItems.Add("IManExt.Import.FileName", NrPort & "\Doc1.doc")
'Note that we have to check it in and then back out again, otherwise it checks out to the wrong place
intKeepCheckedOut = IManage.CheckinOptions.nrDontKeepCheckedOut
objContextItems.Add("IManExt.Import.KeepCheckedOut", intKeepCheckedOut)
'Forces a blank description
objContextItems.Add("ImanExt.Import.DocDescription", "")
objImportCmd = New IMANEXTLib.ImportCmd
objImportCmd.Initialize(objContextItems)
objImportCmd.Update()
If objImportCmd.Status = IMANEXTLib.CommandStatus.nrActiveCommand Then
'Imports the document, throwing a Save As screen at the user
objImportCmd.Execute()
在这一点上,我得到了一个新的 Word 实例,位于我从中保存的那个之上(即,在 Application 之上)。是什么赋予了?