Microsoft access vba-shift focus from access to word -


i creating , opening word document through access 2007 vba. document created focus not shifted word. instead focus still remains on access form through creating doc. below code:

dim obj word.application dim wor word.document dim str string  str = "c:\hello\folder1\vin.dot"  set obj = createobject("word.application") set wor = obj.documents.add  wor   .saveas str   .close end   obj.visible = true obj.documents.open str  obj.windowstate = wdwindowstatemaximize 

any sugesstions please.

you can move focus appactivate;

appactivate "microsoft word" 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -