From 2e68218cfe0b4263f8614cf1b3a15e76b65bfd87 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 10 Jun 2025 16:34:22 -0400 Subject: [PATCH] B2025-034-Add-error-message-documents --- .../DisplayTabControl.cs | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index 5f37d421..cffb5c3c 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -10,6 +10,7 @@ using Volian.Controls.Library; using DevComponents.DotNetBar; using JR.Utils.GUI.Forms; using Volian.Base.Library; +using Microsoft.Win32; namespace Volian.Controls.Library { @@ -658,11 +659,34 @@ namespace Volian.Controls.Library } else // Otherwise open it in the Word editor { - Document.ConvertWordSectionToDOCX(myItemInfo); // B2023-093 Convert a Word section to the DOCX Word format if needed before opening it for edit - return OpenDSOTabPage(myItemInfo); - } - } + // B2025-034 Check to make sure that EDWord is installed in PROMS. If not return NULL. + object EDOfficeViewerX = GetValue(@"HKEY_CLASSES_ROOT\EDOfficeViewerX.Connect\CLSID\", @"", null); + object EDWordCtrl = GetValue(@"HKEY_CLASSES_ROOT\EDWORD.EDWordCtrl.1\CLSID\", @"", null); + + if (EDOfficeViewerX == null || EDWordCtrl == null) + { + + MessageBox.Show("Edraw needs to be installed or reinstalled on this PC. Please contact your IT Administrator to install and register Edraw that was provided with the PROMS Installation media. If additional support is needed, please contact Volian", "Error in Word section", + MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return null; + } + else + { + Document.ConvertWordSectionToDOCX(myItemInfo); // B2023-093 Convert a Word section to the DOCX Word format if needed before opening it for edit + return OpenDSOTabPage(myItemInfo); + } + } + + } + public T GetValue(string registryKeyPath, string value, T defaultValue = default(T)) + { + T retVal = default(T); + + retVal = (T)Registry.GetValue(registryKeyPath, value, defaultValue); + + return retVal; + } public bool PasteRTBItem(ItemInfo myItemInfo, int copyStartID, ItemInfo.EAddpingPart pasteType, int type) { CleanUpClosedItems();