updfate 20250919
This commit is contained in:
@@ -550,6 +550,28 @@ namespace DOCGEN.Klassen
|
||||
// }
|
||||
//}
|
||||
|
||||
try
|
||||
{
|
||||
if (docdata.TextToReplace.Count() > 0)
|
||||
{
|
||||
bool locked = false;
|
||||
if (document.ProtectionType != ProtectionType.NoProtection)
|
||||
{
|
||||
document.Protect(ProtectionType.NoProtection, "Australia");
|
||||
locked = true;
|
||||
}
|
||||
foreach (textreplace tr in docdata.TextToReplace)
|
||||
{
|
||||
Replace_Text(ref document,tr.TextToFind, tr.TextToReplace);
|
||||
}
|
||||
if (locked)
|
||||
{
|
||||
document.Protect(ProtectionType.AllowOnlyFormFields, "Australia");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
foreach (clsDocMacro dm in docdata.DocMacros)
|
||||
{
|
||||
|
||||
@@ -1071,6 +1093,7 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//foreach (IWSection section in document.Sections)
|
||||
//{
|
||||
IWSection section = document.Sections[0];
|
||||
@@ -1087,9 +1110,30 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
WParagraph footerPar = new WParagraph(document);
|
||||
footerPar.ChildEntities.Add(picture2);
|
||||
if (section.HeadersFooters.Footer.Count > 0) { section.HeadersFooters.Footer.Paragraphs.RemoveAt(section.HeadersFooters.Footer.Paragraphs.Count-1); }
|
||||
if (section.HeadersFooters.Footer.Count > 0) { section.HeadersFooters.Footer.Paragraphs.RemoveAt(section.HeadersFooters.Footer.Paragraphs.Count - 1); }
|
||||
section.HeadersFooters.Footer.Paragraphs.Add(footerPar);
|
||||
//}
|
||||
|
||||
//for (int i = 0; i < document.Sections.Count; i++)
|
||||
//{
|
||||
// IWSection section1 = document.Sections[i];
|
||||
// if (section1.PageSetup.DifferentFirstPage == true)
|
||||
// {
|
||||
|
||||
// WParagraph FirstfooterPar1 = new WParagraph(document);
|
||||
// FirstfooterPar1.ChildEntities.Add(picture);
|
||||
// if (section1.HeadersFooters.FirstPageFooter.Paragraphs.Count > 0 && editdoc)
|
||||
// {
|
||||
// section1.HeadersFooters.FirstPageFooter.Paragraphs.RemoveAt(section1.HeadersFooters.FirstPageFooter.Paragraphs.Count - 1);
|
||||
// }
|
||||
// section1.HeadersFooters.FirstPageFooter.Paragraphs.Add(FirstfooterPar1);
|
||||
|
||||
// }
|
||||
// WParagraph footerPar1 = new WParagraph(document);
|
||||
// footerPar1.ChildEntities.Add(picture2);
|
||||
// if (section1.HeadersFooters.Footer.Count > 0 && editdoc) { section1.HeadersFooters.Footer.Paragraphs.RemoveAt(section1.HeadersFooters.Footer.Paragraphs.Count - 1); }
|
||||
// section1.HeadersFooters.Footer.Paragraphs.Add(footerPar1);
|
||||
//}
|
||||
}
|
||||
public void xInsert_Barcode(WordDocument document, clsDocData docData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user