VBA to C# - Word

J

jo

I what to move left in a document if the selection text equals a vbCr
or space:

Do While Asc(Selection.Text) = 32 Or Asc(Selection.Text) =
13
Selection.MoveLeft(Unit:=Word.WdUnits.wdCharacter,
Count:=1)
intCount = intCount + 1
Loop


How do I accomplish this in c#?
 
C

Cindy M.

Hi Jo,

Are you still looking for help on this?

FWIW, the Selection object depends from the Word application object. So
you first need that. Assuming you've assigned it to the object wdApp
then Selection.Text would be:
string theSelectedText = wdApp.Selection.Text

and so on...
I what to move left in a document if the selection text equals a vbCr
or space:

Do While Asc(Selection.Text) = 32 Or Asc(Selection.Text) =
13
Selection.MoveLeft(Unit:=Word.WdUnits.wdCharacter,
Count:=1)
intCount = intCount + 1
Loop


How do I accomplish this in c#?


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
Top