Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Set Cursor position to right after selection in word VBA

I have code that creates fields on a word document based on selection, but when it is done it has the field selected. I want to select the position right after the field. So if there is a FIELD_ with _ being the position right after the field, it is what I want to select.

I found this:

Dim newSelect As Long: newSelect = Selection.End + 1

to get the Character position but then how do I select based on character position? Or is there another method to acheive this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Pls try.

Selection.Collapse Word.wdCollapseEnd

Microsoft documentation:

Selection.Collapse method (Word)

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading