We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to delete the last page in word if its blank

Hi there ,

I have a quick question .



How to figure out if the .doc file has a blank last page and if the blank page exists how to delete that specific last page and save the doc file .



I have uploaded a sample copy for your reference .



Thanks in advance .

Anil

Hi Anil,


Thanks for your inquiry. In this particular case, you can simply remove last section as follows:

Document doc = new Document(MyDir + @“1♣Template+Highlevel+Overview+Print+to+PDF.doc”);

doc.LastSection.Remove();

doc.Save(MyDir + @"15.8.0.doc");


Best regards,