Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / September 2006

Tip: Looking for answers? Try searching our database.

How to counting words in a string variable?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JS - 25 Sep 2006 15:01 GMT
Hi All:
Sorry to ask so many questions - I need to count words, using the
Words.Count Method, in a variable declared as String.
Does anyone know how to do this? I'm being unsuccessful in getting this text
in a TextRange that Words.Counts wants.
Thanks in advance for your help, JS
Brian Reilly, MVP - 25 Sep 2006 15:18 GMT
This works for me here.
MsgBox ActiveWindow.Selection.SlideRange.Shapes("Rectangle
3").TextFrame.TextRange.Words.Count

Brian Reilly, MVP

>Hi All:
>Sorry to ask so many questions - I need to count words, using the
>Words.Count Method, in a variable declared as String.
>Does anyone know how to do this? I'm being unsuccessful in getting this text
>in a TextRange that Words.Counts wants.
>Thanks in advance for your help, JS
JS - 25 Sep 2006 20:28 GMT
Hi Brian,
Thanks for your reply.
Rgds, JS

> This works for me here.
> MsgBox ActiveWindow.Selection.SlideRange.Shapes("Rectangle
[quoted text clipped - 8 lines]
> >in a TextRange that Words.Counts wants.
> >Thanks in advance for your help, JS
Steve Rindsberg - 25 Sep 2006 16:46 GMT
> Hi All:
> Sorry to ask so many questions - I need to count words, using the
> Words.Count Method, in a variable declared as String.
> Does anyone know how to do this? I'm being unsuccessful in getting this text
> in a TextRange that Words.Counts wants.

See Shyam's answer to your earlier post (it's better to keep all of your
messages on a given topic in the same thread, by the way).

His suggestion is that you create a dummy text box and having done that:
(assuming a reference to the text box in oSh)

With oSh.TextFrame.TextRange
  .Text = YourString
  ' do your word count stuff here
End With
oSh.Delete

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
JS - 25 Sep 2006 20:16 GMT
Hi Steve and Shyam:
Steve and Shyam, sorry for posting this question - I thought that since it
was a new question to an answer to another question that it had got lost
under the proverbail stack... my fault... I'm taken back by the so different
way 2000 and 2003 treat the WholeWords parameter in the Replace Method - it
basically ruined all my Find&Replace I've been using for years!
Again, sorry nad thanks for your suggestion.
Rgds, JS

> > Hi All:
> > Sorry to ask so many questions - I need to count words, using the
[quoted text clipped - 19 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 26 Sep 2006 01:31 GMT
> Hi Steve and Shyam:
> Steve and Shyam, sorry for posting this question -

No problem ... that was just a friendly suggestion, not a scold.

>I thought that since it
> was a new question to an answer to another question that it had got lost
[quoted text clipped - 28 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.