iManage ImportCmd launching new instance of Word

1.4k Views Asked by At

I'm trying to save a Word document into iManage using ImportCmd from IMANEXTLib and I'm getting a new instance of Word every time I run it.

I've saved the document to doc1.doc, and then:

    '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()

And at this point, I get a new instance of Word, on top of the one I was saving from (ie, on top of Application). What gives?

3

There are 3 best solutions below

0
On BEST ANSWER

Just to provide a resolution, I noticed that the problem only occurred under one user account (mine) and then I just deleted my user profile. My shiny! new! profile doesn't have the same problem.

0
On

You can try with save command other than iManage. For testing, you can create a demo word document and then try to save the word document from within the MS WORD application itself just to check which pop up window is visible. If the document is getting saved as with the desired normal behaviour then it means there is problem with your code but if again a new word application is getting opened then its a problem with your application.

You can probably try for both Save As and local Save As using iManage within the MS WORD application. If both works fine then try with an alternative save command in your code.

1
On

I hope this doesn't seem like a cop-out, but I'd contact Interwoven supprot (or whomever has bought them out this month).