My Assistant
![]() ![]() |
|
|
Sep 5 2006, 12:02 PM
Post
#1
|
|
|
UtterAccess Veteran Posts: 413 From: Montreal, Canada |
Hi everyone!
I searched for posts about returning the focus on the Access window after opening a word doc but I can't seem to find one. I tried this but it doesn't seem to work. my code would be something like: CODE Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Add(strFilePath & strFileName) objWord.Visible = True [color="red"]'Missing line : Return focus to Access window [/color] DoCmd.SelectObject acReport, strDocName Any idea ? |
|
|
|
Sep 5 2006, 12:48 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Hi,
so you can't just return focus to something within the Access shell? Have you tried the SetForeGroundWindow API or the SetActiveWindow API? There should be samples for both in the links. HTH Good luck |
|
|
|
Sep 5 2006, 02:44 PM
Post
#3
|
|
|
UtterAccess Veteran Posts: 413 From: Montreal, Canada |
Hi Oliver,
I tried both and it doesn't do anything. I don't understand why... For now I can use Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Add(strFilePath & strFileName) objWord.Visible = True' SendKeys "%{TAB}" DoCmd.SelectObject acReport, strDocName but I'd like to have a better solution. Thanks again! I'll keep trying your examples... |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 05:24 AM |