I am trying to open an email message (MIME) through my vb.net application.. its working but leaves the document checked out after I close the message. Same thing happens for .txt documents as well..I've read articles with such kind of issue and they were pointing at either using openROCmd or setting registry OpenAsReadOnlyTypes=MIME...I tried using the registry method and if I do that it dosen't launch the document at all..i m using this open command to open any type of document such as .doc,.pdf,.txt etc so I can't use the other method of using OpenROCmd...could u pls suggest any other way to solve this problem or am I missiing something in my code??here is my code:*********************************************************** objcontextitems = New IMANEXTLib.ContextItems objOpencmd = New IMANEXTLib.OpenCmd objDocArray(0) = oDoc objcontextitems.Add("ManDMS", oDMS) objcontextitems.Add("ParentWindow", 0) objcontextitems.Add("SelectedNRTDocuments", objDocArray) objcontextitems.Add("IManExt.OpenCmd.NoCmdUI", False) objcontextitems.Add("IManExt.OpenCmd.Integration", False) objOpencmd.Initialize(objcontextitems) objOpencmd.Update() If objOpencmd.Status = IMANEXTLib.CommandStatus.nrGrayedCommand Then GoTo myerr Else objOpencmd.Execute() bRefresh = objcontextitems.Item("ImanExt.Refresh") End If oDoc.Refresh() objcontextitems.Remove("IManExt.Refresh") oDoc = Nothing objcontextitems = Nothing objOpencmd = Nothing objDocArray(0) = Nothing***********************************************************Awaiting for your reply...Regards,Bhavin
Thank you jny for your quick reply.. I can understand your point...My program is designed to open a document by its docid and to workaround this problem I've to determine if the document i am going to open is an email message or a text file, so that i can use openROcmd instead of opencmd...Is there a way i can find out the document type through its docid..??Regards,Bhavin
Hi jny,Now I am using OpenROCmd to open email, text files, pdf etc.. they are working fine.. The only problem is it leaves the copy of the document into the NrPrbl directory.. and when you open the same document from filesite you get the following dialog..Is there any way to fix this?Regards,Bhavin
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using IManage;using IMANEXTLib;namespace DSS_ThrowAway_Test{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //DSS Repro Test: Case-00732196/Jame Ly //Check for the presence of FileSite AppModeCmd cmdConnection = new AppModeCmd(); ContextItems context = new ContextItems(); enumAppModeExec eOperationMode =enumAppModeExec.nrCreateOnlineAppModeWindow; context.Add ("ParentWindow", this.Handle.ToInt32()); context.Add ("IManExt.AppMode.Operation", eOperationMode);//set to online context.Add ("IManExt.AppMode.AppName", "FileSite");//WorkSite app to check cmdConnection.Initialize (context); cmdConnection.Update(); cmdConnection.Execute(); string strAppName = (string)context.Item("IManExt.AppMode.AppName"); // This returns the name of the WorkSite Client that iscurrently launched enumAppMode eAppMode =(enumAppMode)context.Item("IManExt.AppMode"); // This returns the connection mode // 0 = No connection established (IManExt.AppMode.AppNameshould respectively return empty string) // 1 = On-line // 2 = Off-line INRTDMS dms = new NRTDMSClass(); INRTSession sess = dms.Sessions.Add("DSS_WIN2003SERV", null,null); sess.TrustedLogin(); OpenDocument(this.Handle.ToInt32(), sess.ServerName,sess.PreferredDatabase, 1499, 1, eAppMode); } public void OpenDocument(long HWND, string Server, INRTDatabaseDatabase, int DocNumber, int Version, enumAppMode eAppMode) { //IManage.NRTSession session =IManage.NRTSession)iManageIndexCache[Server]; //IManage.INRTDatabase database = //session.Databases.Item(Database); //IManage.NRTDocument[] arrDocs = newIManage.NRTDocument[1]; NRTDocument[] arrDocs = new NRTDocument[1]; arrDocs[0] = Database.GetDocument(DocNumber, Version); IMANEXTLib.ContextItems contextItems = newIMANEXTLib.ContextItemsClass(); ; contextItems.Add("ParentWindow", HWND); contextItems.Add("SelectedNRTDocuments", arrDocs); if (arrDocs[0].Type.Description.ToLower() == "mime") contextItems.Add("IManExt.OpenCmd.ReadOnly", true); IMANEXTLib.OpenCmd openCmd = new IMANEXTLib.OpenCmdClass(); openCmd.Initialize(contextItems); openCmd.Update(); try { openCmd.Execute(); bool brefresh = (bool)contextItems.Item("IManExt.Refresh"); if (brefresh == true) { if (eAppMode == enumAppMode.nrOnline) { string sDownloadedPath =contextItems.Item("IManExt.ReturnedNRTURL").ToString(); System.Diagnostics.Process.Start(sDownloadedPath); } } } catch (System.ArgumentException argEx) { System.Diagnostics.Debug.WriteLine(argEx); } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Close(); } }}