Beispiel #1
0
        /// <summary>
        /// Open document for Document type
        /// </summary>
        /// <param name="document"></param>
        public static void OpenDocument(Document.Document document, object vkReadOnly)
        {
            if (document.DocumentType == Utils.DocumentType.WORD)
            {
                string filePathName =
                    Utils.getFilePathName(document.Location,
                                          document.Name);

                WordDocumentTasks.OpenDocument(filePathName, vkReadOnly);
            }
        }
Beispiel #2
0
        // Open document for Location and Name
        //
        public static void OpenDocument(string Location, string Name, string Type, object vkReadOnly)
        {
            if (Type == Utils.DocumentType.WORD)
            {
                string filePathName =
                    Utils.getFilePathName(Location,
                                          Name);

                WordDocumentTasks.OpenDocument(filePathName, vkReadOnly);
            }

            if (Type == Utils.DocumentType.EXCEL)
            {
                string filePathName =
                    Utils.getFilePathName(Location,
                                          Name);

                var Response = ExcelSpreadsheetTasks.OpenDocument(filePathName);
                if (Response.ReturnCode < 1)
                {
                    MessageBox.Show(Response.Message);
                }
            }
            if (Type == Utils.DocumentType.PDF)
            {
                string filePathName =
                    Utils.getFilePathName(Location,
                                          Name);
                System.Diagnostics.Process proc = new System.Diagnostics.Process();
                var adobe = CodeValue.GetCodeValueExtended(iCodeType: FCMConstant.CodeTypeString.SYSTSET, iCodeValueID: "PDFEXEPATH");

                if (!File.Exists(adobe))
                {
                    MessageBox.Show("I can't find Adobe Reader. Please configure SYSTSET.PDFEXTPATH.");
                    return;
                }

                proc.StartInfo.FileName  = adobe;
                proc.StartInfo.Arguments = filePathName;
                proc.Start();
            }
        }