Karl (or others):
I am trying to count "forward slashes". "/"
The routine you suggested works perfectly in Word2003. And it works
perfectly in Word2007 if there are no images. But if there are images within
the selected text, the images get counted as a slash, messing up the count.
Is there another technique? (Is this a bug in Word2007)?
Example: Texttexttext/(image1)Texttexttext2/(image2)Texttexttext3
Ed (in Virginia)
"Karl E. Peterson"
news:OVoIYTVhIHA.4740@TK2MSFTNGP05.phx.gbl...
> Ed wrote:
>> Is there a function that counts the number of times a particular
>> character
>> appears within a selection? Thanks.
>
> Get the selection into a string (I'm not an object model guy; I just do
> code
>
> TheCount = UBound(Split(Selection, TheChar))
>
> For example:
>
> ?ubound(split("l;kjwet;kew", "c"))
> 0
> ?ubound(split("abcabcabcab", "c"))
> 3
>
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>