Hi,I am trying to open a filesite document from within excel, i have been reading through various examples in this forum and still have not quite been able to achieve the desired result.This is what i have so far.Private Sub Form_Load()' WorkSite 8.0Dim dms As New ManDMSDim sess As IManSessionDim doc As IManDocument' IManExt 8.0Dim cmd As OpenROCmdDim context As ContextItems' localDim num, ver As LongDim saDox(0) As NRTDocumentnum = 12708389ver = 1Set sess = dms.Sessions.Add("MY-SERVER")sess.TrustedLoginIf sess.Connected Then' Get document object handle Set doc = sess.Databases.ItemByName("MY_DATABASE").GetDocument(num, ver) If Not doc Is Nothing Then Set saDox(0) = doc ' Populate the ContextItems for the OpenCmd Object Set context = New ContextItems With context '.Add "ParentWindow", Application.hWnd .Add "SelectedIManContent", doc .Add "SelectedIManObjects", saDox(0) .Add "IManExt.OpenCmd.NoCmdUI", True End With ' Invoke an instance of the OpenCmd Object Set cmd = New OpenCmd With cmd .Initialize context If cmd.Status = (cmd.Status & nrActiveCommand) Then .Execute Dim filLoc As String filLoc = context("IManExt.OpenCmd.ING.FileLocation") ' Get the checkedout path Workbooks.Open (filLoc) End If End With End IfEnd IfEnd SubIt fails at filLoc = context("IManExt.OpenCmd.ING.FileLocation") with "Unable to obtain selected document(s) information. The current database or server might be unavailable".The database and server are both fine and doc definately holds the document i am looking for as i am able to get at its properties.Does anyone know if i am missing anything or am i using the complete wrong approach.I only need to open the file briefly to extract a figure and then close it so i using OpenROcmd to open it read only.Any assistance is greatly appreciated and if you need me to clarify something please let me know.Many thanksTim
Thanks for your reply JNY, i am still getting the same error though, can you think of anything else that might cause this?These are my context items now. Set doc = sess.Databases.ItemByName("London_10").GetDocument(num, ver) If Not doc Is Nothing Then Set saDox(0) = doc Set context = New ContextItems With context .Add "SelectedIManObjects", saDox(0) .Add "IManExt.OpenCmd.NoCmdUI", True .Add "IManExt.OpenCmd.Integration", True End Withand this is me trying to invoke the opencmd object. Set cmd = New OpenCmd With cmd .Initialize context If cmd.Status = (cmd.Status & nrActiveCommand) Then .Update .Execute Dim filLoc As String filLoc = context("IManExt.OpenCmd.ING.FileLocation") ' Get the checkedout path Workbooks.Open (filLoc) End If End WithIt still fails at filLoc = context("IManExt.OpenCmd.ING.FileLocation") with "Unable to obtain selected document(s) information. The current database or server might be unavailable".I cant understand why i am getting this error message as i can have a handle on the database object and i can extract properties from the document i am trying to open, i just cant seem to execute the opencmd on it.Any ideas at all??Your assitance is greatly appreciated.Many thanksTim