0
if you do not want to use the microsoft interop services, you can check out the leadtools sdk. the LEAD sdk lets you load word documents (as well as all other microsoft formats, pdfs, and images) and rearrange the pages, delete pages, add pages, then save the document back out to whatever format that you want. check out this link for more information
https://www.leadtools.com/support/forum/posts/t12249-Code-Tip---NET-Virtual-Document-Demo
0
This is how you can delete a particular or multiple pages from a document in C#
- string filePath = @"c:\sample.docx";
- string filePathOut = @"c:\output\result.docx";
- RemoveOptions removeOptions = new RemoveOptions(new int[] { 3, 5 }); //3 and 5 are the page numbers
- using (Merger merger = new Merger(filePath))
- {
- merger.RemovePages(removeOptions);
- merger.Save(filePathOut);
- }
You have to add GroupDocs.Merger for .NET DLL in order to run this piece of code.
0
int[] b = { 15, 17 };
for (int i = 0; i <= 1; i++)
{
object goname1 = b[i];
objWordDoc.Application.Selection.GoTo(Word.WdGoToItem.wdGoToPage, Word.WdGoToDirection.wdGoToAbsolute, null, goname1);
objWordDoc.Application.Selection.Bookmarks[@"\Page"].Select();
objWordDoc.Application.Selection.Delete();
}
It works only for even numbers ?
0
it is not what i want
i want that the file that existing in the project should be diplayed automatically when page loads.
0
It wont works...
Could you please help me...