Pagesetup SectionStart


#1

Hi,

I’m ‘stitching’ documents together using the sections method as described in this forum. However they each have a page break between the sections. I have got the latest Hotfix and have access to the SectionStart property in PageSetup for a section.

However when I try to access SectionStart I get a NullReferenceException error.

while (doc.Sections.Count > 0)
{
Section srcsection = doc.Sections[0];
doc.Sections.RemoveAt(0);
srcsection.PageSetup.SectionStart = SectionStart.Continuous;
dest.Sections.Add(srcsection);
}


Could you point me in the right direction?

Regards,
Gary.


#2

Strictly speaking, when section is removed from a document, it is not really functional. So if you try changing SectionStart before your remove the section or after your add it, it could help.

Let me know if that does not help. I will investigate this issue further.


#3

Please get latest Aspose.Word 1.9.8 as we fixed Section.PageSetup access violation, but you still need to change your code to access PageSetup AFTER you add the section to a document.