Author | Topic: Re: setting input focus to a worddocument | |
---|---|---|
Donald R. Keating | Re: setting input focus to a worddocument on Mon, 05 Jan 2009 18:28:28 -0500 On Fri, 31 Aug 2007 10:01:32 +0200, Ronald van Veelen wrote: > Op Tue, 28 Aug 2007 14:24:15 +0200 schreef Olaf870: > > > Hello, > > in last thread about this problem three have been a lot of proposals, but > > nothing worked, when i tried it. > > I want to ask, if somebody really solved the problem to give the input focus > > to a worddocument with 1.9? If yes, which fixes are installed/not installed? > > regards > > Olaf870 > > hi Olaf, > > try this: > > ::oApp := GetObject(, Word.Application) > ::oDoc := ::oApp:documents:open() > > ::oApp:visible := .t. > ::oDoc:Parent:activate() > ::oApp:activeWindow:setFocus() > > For some explanation (which I do not get entirely): > http://word.mvps.org/faqs/MacrosVBA/ActivateNewDocument.htm > > Unfortunately this only works for the first document you open. If there is > a document opened... it will not work. > So if you find out how to do it with multiple documents We would have a > complete solution. > > regards Ronald Ronald, A quick note! I've tried to figure this on my own and after several hours came to the NG. Found several "solutions" but, yours is the only one I can make work. Thanks very much! >don< |