I a program, i call Word or Excel with OLE.
How can i put the focus on the word or excel application , how
to put it on the top ?
Thanks
I a program, i call Word or Excel with OLE.
How can i put the focus on the word or excel application , how
to put it on the top ?
Thanks
Jack,
I'd like to know that too.
(Just to bring this topic to the top)
Regards.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Jack, Michel,
Basically you find the window using FindWindow() and then you can use SetFocus(), BringWindowToTop() or SetForegroundWindow() to give it the focus.
BringWindowToTop(FindWindow("OpusApp",NIL))Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
#define outlookFolderCalendar 9
function Main()
local oOutlook := CreateObject( "Outlook.Application" )
local oNameSpace := oOutlook:GetNameSpace( "MAPI" )
local oCalendar := oNameSpace:GetDefaultFolder( outlookFolderCalendar )
local nItems := oCalendar:Items:Count, n
for n = 1 to nItems
MsgInfo( oCalendar:Items[ n ]:Start )
MsgInfo( oCalendar:Items[ n ]:End )
MsgInfo( oCalendar:Items[ n ]:Subject )
MsgInfo( oCalendar:Items[ n ]:Body )
next
oCalendar := nil
oNameSpace := nil
oOutlook := nil
return nil#define outlookFolderCalendar 9
function Main()
local oOutlook := CreateObject( "Outlook.Application" )
local oNameSpace := oOutlook:GetNameSpace( "MAPI" )
local oCalendar := oNameSpace:GetDefaultFolder( outlookFolderCalendar )
local oItem := oOutLook:CreateItem( 1 )
oItem:Start = Date()
oItem:End = Date()
oItem:Subject = "A test"
oItem:Save()
MsgInfo( "check Outlook calendar for today" )
oCalendar = nil
oNameSpace = nil
oOutlook = nil
oItem = nil
return nilAntonio,
Since I am visiting costumers for almost the whole day today, I'll come back to it tonight or tomorrow.
Thanks a lot.
Regards,
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Thanks for this answer .
Could you give a sample .
The name of the word document opened with ole is "facture.doc" ,
it is locate in "c:\data" folder .
I want to put the word document on top and set the focus on word .
Thanks .