Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm new to the pleasures of Word VBA. I have a form that the user keys in which in turn populates the Word document with the user entered values. Once submitted, I would like the focus to be at a certain point in the document. I know that for standard textboxes this can be achieved by using the SetFocus method.

This doesn't seem to be available for content controls though. I would like to avoid using bookmarks as I believe people are moving more towards content controls. I suppose I have a couple of questions:

1. Should I use content controls to accomplish this? If not how/what should I use?

2. If content controls is the way forward for these kinds of problems, how can I set the focus to the content control?

Thanks!
Posted

Set a bookmark, say "MyBookmark" and use the following statement in your VBA code:
Selection.GoTo What:=wdGoToBookmark, Name:="MyBookmark"
 
Share this answer
 
Thanks, that's great!

Bookmarks is good.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900