c_shah

I have a old wordbasic code that I am converting to VSTO
what is equivalent of Word 97 (WordBasic) code WordBasic.SelectCurWord  in VSTO

Tried several alternatives

wordApp.Selection.Words.Item(1).Select() OR WordRange.Words.Item(1).Select()

but it picks up an extra space while WordBasic.SelectCurWord   does not

Here is my situation, following line in my word doc represents a bookmark. I am at  the bookmark position         wordApp.Selection.Words.Item(1).Select()  an extra space (including a space and reaches upto  beginning of word excess)

 As it respects the Limit of Liability $ I_______________ excess of $ _______________ , it is



Re: Visual Studio Tools for Office Word VSTO Equivalent of WordBasic.SelectCurWord

c_shah

tried this WordApp.Selection.Expand(Word.WdUnits.wdWord) but it still includes an extra space





Re: Visual Studio Tools for Office Word VSTO Equivalent of WordBasic.SelectCurWord

Amani Ahmed

Unfortunately, there isn't an "exact" (no whitespace included) equivalent in VBA for what you are trying to do. You'll need to write the code to remove the extra space yourself.






Re: Visual Studio Tools for Office Word VSTO Equivalent of WordBasic.SelectCurWord

c_shah

I ended up removing an extra space programmatically. Thanks!