Update 20250206
This commit is contained in:
@@ -1560,7 +1560,9 @@ namespace OnDocOffice
|
||||
Start_Application();
|
||||
//word.Visible = true;
|
||||
word.Documents.Open(filename);
|
||||
word.Visible = true;
|
||||
|
||||
|
||||
string path_unterschriftlinks = "";
|
||||
string path_unterschriftrechts = "";
|
||||
if ( unterschriftlinks != "-1")
|
||||
@@ -1601,11 +1603,20 @@ namespace OnDocOffice
|
||||
|
||||
public class word_signature
|
||||
{
|
||||
bool is_protected = false;
|
||||
Microsoft.Office.Interop.Word.Document docWord;
|
||||
public bool sign_doc(ref Microsoft.Office.Interop.Word.Application word, string imagepath_ul, string imagepath_ur, string dokumentid)
|
||||
{
|
||||
Logging.Logging.Debug("Sign_Doc", "OnDoc", dokumentid);
|
||||
docWord = word.ActiveDocument;
|
||||
Thread.Sleep(1000);
|
||||
if (word.ActiveDocument.ProtectionType != Microsoft.Office.Interop.Word.WdProtectionType.wdNoProtection)
|
||||
{
|
||||
word.ActiveDocument.Unprotect(Password: "Australia");
|
||||
is_protected = true;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
foreach (Microsoft.Office.Interop.Word.Bookmark bm in docWord.Bookmarks)
|
||||
@@ -1621,6 +1632,16 @@ namespace OnDocOffice
|
||||
|
||||
}
|
||||
//docword = docWord; ;
|
||||
if (is_protected)
|
||||
{
|
||||
try
|
||||
{
|
||||
word.ActiveDocument.Protect(Type: Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyFormFields, NoReset: true, Password: "Australia");
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
Thread.Sleep(1000);
|
||||
|
||||
Logging.Logging.Debug("Ende Sign_Doc", "OnDoc", dokumentid);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user