in reply to Re: How to get MS-Word Page count and line count?
in thread How to get MS-Word Page count and line count?
Try this code. It's untested, and I never get it right if you need the
{} around Count or not.
As for the line count, your going to have a problems here. Word probably does not mark new lines as you would expect. It automaticly wraps based on the available space. So instead of looking for line count you could do Sentence->Count.my $doc = $word->Application->Selection; # Selection can be the entire doc or refined to a sub-set of text # It is easier to use the functions that exist in word to do the work. $num_paragraphs = $selection->Paragraphs->{Count}; $num_words = $selection->Words->{Count}; $num_chars = $selection->Characters->{Count}; $num_pages = $selection->pagenumbers->{Count};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: How to get MS-Word Page count and line count?
by Zero_Flop (Pilgrim) on Mar 08, 2004 at 22:46 UTC | |
by nicholas (Novice) on Mar 09, 2004 at 06:36 UTC | |
Re: Re: Re: How to get MS-Word Page count and line count?
by nicholas (Novice) on Mar 08, 2004 at 12:15 UTC |
In Section
Seekers of Perl Wisdom