Re: How to counting words in a string variable?



In article <uihGloK4GHA.1068@xxxxxxxxxxxxxxxxxxxx>, Js wrote:
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
================================================


.



Relevant Pages

  • Re: Action Settings work on Windows, but not Mac
    ... convert the result back to string. ... the first time you click on the link and invoke the macro. ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: Replace text not working
    ... "Steve Rindsberg" wrote: ... reference to the SlideMaster, TitleMaster etc., FindString is the string to ... When FindString is "Commercial" the replacement works fine. ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: Need to hyperlink from word to a .PPS so that it will autostar
    ... > ByVal lpOperation As String, ByVal lpFile As String, _ ... >> MervB ... >>> Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: positioning input box
    ... It acted as if the string I used for the ... >> Sub GetInput() ... >> Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: Replace text not working
    ... "Steve Rindsberg" wrote: ... reference to the SlideMaster, TitleMaster etc., FindString is the string to ... When FindString is "Commercial" the replacement works fine. ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)