Skip to main content
Inspiring
September 27, 2010
Question

Getting number of Words in a Frame in CS4

  • September 27, 2010
  • 1 reply
  • 483 views

Hello All,

I am trying to get the number of words in a Text Frame. I tried the API GetWordCountInfo of ITextUtils

For E.g. Utils<ITextUtils>()->GetWordCountInfo(  iTextmodel, 0,  iTotalLength, ITextUtils::kUpdateAll, ITextUtils::kStartCounting,
      wordStarted,  characters,   words,   paragraphs,  lines, oversetCharacters,  oversetWords,  oversetParagraphs, oversetLines,  bWordAcrossOverset,
      helper  );

I am took the value of words and checked. I am getting value such as 2049679. Even though there is no text in the frame. Am not sure what wrong value I have given as a parameter required.

Has anyone tried this before. Or Is there some other way of getting the word count from the frame. If so please do let me know.

Thank you all in advance.

Regards

Farzana.

This topic has been closed for replies.

1 reply

September 27, 2010

Make sure you are sending in unsigned int32's to hold the return values.

Inspiring
September 27, 2010

Hi ,

I have declared the parameters to the function as uint32.

And when I see them in alert I am converting the same to int32 by using ToInt32(). I tried using uint32 appending directly as number to my string variable. But it gives same output in alert.

Thanks

Regards

Farzana,