Iterate Paragraphs in Word

88 Views Asked by At

I need to find out all the paragraphs in a word document. Word Document gives Paragraphs using struct Paragraphs * Paragraphs;

The Paragraphs gives First and Last Paragraph

struct Paragraph * First;
struct Paragraph * Last;

Now I do not know how to iterate all the paragraphs.

Need Help. Probably has got to do something with __declspec(property(get=Get_NewEnum))

1

There are 1 best solutions below

0
A M On
struct Paragraph* First;
struct Paragraph* Last;
struct Paragraph* Current;

for (Current = First; Current < Last; ++Current) {
    // DO something with current
}

Additional info:

  • Do not use raw pointers
  • Do not use C-Style arrays
  • Do not use pointer arithmentic
  • Learn at least a minimum C++
  • Read some good books
  • After all that, start writing code. Not before.