Update 20250219 - OfficeHandling

master
Stefan Hutter 10 months ago
parent 8bd079b635
commit 986e225bd9

@ -50,7 +50,7 @@
<value>E:\Software-Projekte\EDOKA\Cleint_Erneuerung_DMS_Framwork48 - Kopie\EDOKA\bin\edoka.exe</value>
</setting>
<setting name="OfficeWatchTimerIntervall" serializeAs="String">
<value>5000</value>
<value>20000</value>
</setting>
<setting name="NativVorlagen" serializeAs="String">
<value>E:\Software-Projekte\OnDoc\TKB-Vorlagen\</value>

@ -7,6 +7,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
using Database;
using Syncfusion.Windows.Forms.Tools;
using Syncfusion.WinForms.Input.Enums;
@ -62,6 +63,10 @@ namespace OnDoc.Klassen
if (fc.filedatetime < DateTime.Now.AddSeconds(-5))
{
found = false;
word = false;
excel = false;
pdf = false;
Logging.Logging.Debug(fc.application + " / FileChek " + fc.filename + " / " + fc.filedatetime.ToString("yyyy-MM-dd hh:mm:ss") + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "OnDoc.Processwatch", fc.dokumentid);
if (fc.application == "Word") { word = true; }
if (fc.application == "Excel") { excel = true; }
@ -69,21 +74,34 @@ namespace OnDoc.Klassen
if (word)
{
Thread.Sleep(200);
Process[] localByName = Process.GetProcessesByName("WINWORD");
foreach (Process p in localByName)
{
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1) { found = true; }
Logging.Logging.Debug(fc.dokumentid + "/" + p.MainWindowTitle, "", "");
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1)
{
found = true;
save_to_db(fc);
break;
}
}
}
if (excel)
{
Process[] localByName = Process.GetProcessesByName("EXCEL");
foreach (Process p in localByName)
{
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > 0) { found = true; }
if (p.MainWindowTitle.IndexOf(fc.dokumentid) > -1) {
found = true;
save_to_db(fc);
}
}
}
if (!found)
{

@ -53,6 +53,7 @@ using Syncfusion.Windows.Forms.Edit.Utils;
using Syncfusion.WinForms.DataGrid.Serialization;
using NLog.LayoutRenderers;
using Syncfusion.Windows.Forms.PivotAnalysis;
using System.Xml.Linq;
@ -560,11 +561,31 @@ namespace OnDoc.UICintrols
//runmacros = dokbearbeitung.runmacros;
string filename = dokbearbeitung.filename;
string ext = System.IO.Path.GetExtension(filename);
string apptype = "";
switch (ext.ToUpper())
{
case ".DOCX":
case ".DOCM":
case ".DOC":
case ".DOT":
case ".WORD":
case ".DOTM":
apptype = "Word";
break;
case ".XLSM":
case ".XLSX":
case ".XLST":
case ".XLS":
case ".XLT":
apptype = "Excel";
break;
}
Logging.Logging.Debug("Doklist Docfunction=6", "Doklist", "");
//db1.Dok_in_Bearbeitung(1, selected_dokumentid, AppParams.CurrentMitarbeiter);
//db1 = null;
clsProcessWatch.AddToList(selected_dokumentid, filename, "Word");
clsProcessWatch.AddToList(selected_dokumentid, filename, apptype);
break;
default:
break;
@ -670,6 +691,7 @@ namespace OnDoc.UICintrols
tempfilename = fh.save_temp_file(dok.dokument, selected_dokumentid, AppParams.tempdir, dok.extension);
//System.Diagnostics.Process.Start(tempfilename);
interop = true;
if (interop == true)
{
OnDocOffice.clsWordEdit WordInterOP = new OnDocOffice.clsWordEdit(AppParams.connectionstring, tempfilename, selected_dokumentid, AppParams.RESTURI, AppParams.apikey);
@ -960,7 +982,27 @@ namespace OnDoc.UICintrols
Logging.Logging.Debug("Doklist Docfunction=6", "Doklist", "");
db.Dok_in_Bearbeitung(1, selected_dokumentid, AppParams.CurrentMitarbeiter);
db = null;
clsProcessWatch.AddToList(selected_dokumentid, filename, "Word");
string ext = System.IO.Path.GetExtension(filename);
string apptype = "";
switch (ext.ToUpper())
{
case ".DOCX":
case ".DOCM":
case ".DOC":
case ".DOT":
case ".WORD":
case ".DOTM":
apptype = "Word";
break;
case ".XLSM":
case ".XLSX":
case ".XLST":
case ".XLS":
case ".XLT":
apptype = "Excel";
break;
}
clsProcessWatch.AddToList(selected_dokumentid, filename, apptype);
break;
default:
break;

Binary file not shown.

@ -50,7 +50,7 @@
<value>E:\Software-Projekte\EDOKA\Cleint_Erneuerung_DMS_Framwork48 - Kopie\EDOKA\bin\edoka.exe</value>
</setting>
<setting name="OfficeWatchTimerIntervall" serializeAs="String">
<value>5000</value>
<value>20000</value>
</setting>
<setting name="NativVorlagen" serializeAs="String">
<value>E:\Software-Projekte\OnDoc\TKB-Vorlagen\</value>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save