12

Word, very slow reading of paragraphs on some pages

 2 years ago
source link: https://www.codeproject.com/Questions/5317536/Word-very-slow-reading-of-paragraphs-on-some-pages
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

I have this document:https://mega.nz/file/EgIXQCCS#V3SjNh9-H32MCjMqQvRIGjXfj6qxlrPmLdwdIQcAxWQ

I want to read all the paragraphs of the document and I have a loop where I iterate to read the paragraphs and when it reaches the pages 2552-2620 / 2695-2954 slows down dramatically and can take days to read all the paragraphs in the file.

I have been able to know how to retrieve the paragraphs of a specific page, to skip the number of paragraphs that it contains, but the paragraphs on the page do not match the paragraphs in the document's paragraph loop.

The content of those pages does not interest me because they are tables. If possible, I would like to skip those pages. any solution?

Copy Code
Application application = new Application();
     Document document = application.Documents.Open("C:\\word.doc");
            
     foreach (Microsoft.Office.Interop.Word.Paragraph MyParagraph in document.Paragraphs)
     {   int  Page = MyParagraph.Range.Information[Microsoft.Office.Interop.Word.WdInformation.wdActiveEndPageNumber];
            
         if ((Page >= 2552 && Page <= 2620) || (Page >= 2695 && Page <= 2954))
         {    
         }
      }
     application.Quit();


What I have tried:

everywhere and on the internet.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK