Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with counting fields

Status
Not open for further replies.

MareTino

Programmer
Jul 24, 2006
1
NL
I want to extract all formula's from a document. The problem arises when I need to extract formulas from tables.

I use a loop :

dim parTeller as Paragraph
dim docInput as Document
for each parTeller in docInput

next parTeller

and check each paragraph for embedded objects:
For Each objCounter In parTeller.Range.Fields
If objectTeller.Type = wdFieldEmbed Then
FieldToDoc docExport, objCounter
endif
Next

Somehow when Word gets to the last paragraph of a cell he counts all fields in the cell instead of the ones in the paragraph of the cell. So now he extracts the formula double.

I need to loop through the paragraphs because I sometimes need to copy additional information.


Does anyone have a solution or way around this?


Martijn Peeters

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top