VBA forms populate document - Keeping Focus

D

duritza

Hi, i have developed a corporate memo template for our organisation using VBA
forms to populate fields in bookmarks on a document. This works a treat
except that the final document does not get focus and the user has to click
in the window in order to continue typing. I have tried numerous different
code samples that i have found on the net but to no avail. The cusror seems
to flash once but then focus is lost. Could someone please help before my
sanity is lost aswell?
 
D

Doug Robbins - Word MVP

I usually have a bookmark in the template that I call "text", though the
name has no bearing, and use the command

ActiveDocument.Bookmarks("text").Range.Select

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

duritza

Thanks for your response Doug. I tried you code but i'm still suffering the
same problem. Perhaps i should have explained in my blurb that the VBA code
actually opens a new document and copies the template data as well as the
user input to this doc. In other words, it does not populate the template
itself. I dont know if this has a bearing on how i give it focus?
 
J

Jean-Guy Marcil

duritza was telling us:
duritza nous racontait que :
Thanks for your response Doug. I tried you code but i'm still
suffering the same problem. Perhaps i should have explained in my
blurb that the VBA code actually opens a new document and copies the
template data as well as the user input to this doc. In other words,
it does not populate the template itself. I dont know if this has a
bearing on how i give it focus?

I think you should explain exactly what is the procedure you are using to
create your documents from the template.

From What I read, it seems that the user opens the actual template, then the
code create a new document form this template.

This is not how it should be done.

But I may have misunderstood, hence my comments regarding your explaining
the procedure you are using to create you documents form the template.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top