Error while using Docx.Editor.Assign
Posted: Fri Mar 18, 2022 9:07 am
Hello
In the last few versions we have a big problem
When we try to Assign a document to another we get an exception error
TmplDOCX := TDOCXReadWriteVcl.Create(Nil);
TmplDOCX.Editor.Clear; // == open
TmplDOCX.Clear; // == open
TmplDOCX.LoadFromFile(TmplFile);
DetailDOCX := TDOCXReadWriteVcl.Create(Nil);
DetailDOCX.Editor.Assign(TmplDOCX.Editor); <<----- Exception.
Not all the time. It depends on the type of document we load in TmplDOCX.
After following your code a little we fount that in AXWLogEditor.pas
and in AssignBookmarks procedure the value of the sSrc.LastPara comes sometimes as nil thus the exception.
This is a major issue for us and we would appreciate a fast fix.
Usually we load and try to assign documents with many tables, formatted text etc but i have not been able to determine the reason for this as the error occurs in different documents and in different locations (some clipping of text was involved)
Please inform us if you want a sample doc.
Thanks in advance
In the last few versions we have a big problem
When we try to Assign a document to another we get an exception error
TmplDOCX := TDOCXReadWriteVcl.Create(Nil);
TmplDOCX.Editor.Clear; // == open
TmplDOCX.Clear; // == open
TmplDOCX.LoadFromFile(TmplFile);
DetailDOCX := TDOCXReadWriteVcl.Create(Nil);
DetailDOCX.Editor.Assign(TmplDOCX.Editor); <<----- Exception.
Not all the time. It depends on the type of document we load in TmplDOCX.
After following your code a little we fount that in AXWLogEditor.pas
and in AssignBookmarks procedure the value of the sSrc.LastPara comes sometimes as nil thus the exception.
This is a major issue for us and we would appreciate a fast fix.
Usually we load and try to assign documents with many tables, formatted text etc but i have not been able to determine the reason for this as the error occurs in different documents and in different locations (some clipping of text was involved)
Please inform us if you want a sample doc.
Thanks in advance