B2025-034-Add-error-message-documents

This commit is contained in:
Paul Larsen 2025-06-10 16:34:22 -04:00
parent 80f3568dbd
commit 2e68218cfe

View File

@ -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
{
@ -657,12 +658,35 @@ namespace Volian.Controls.Library
return OpenStepTabPage(myItemInfo, setFocus);
}
else // Otherwise open it in the Word editor
{
// B2025-034 Check to make sure that EDWord is installed in PROMS. If not return NULL.
object EDOfficeViewerX = GetValue<object>(@"HKEY_CLASSES_ROOT\EDOfficeViewerX.Connect\CLSID\", @"", null);
object EDWordCtrl = GetValue<object>(@"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<T>(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();