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
Set Focus On a application
Jack,
I'd like to know that too.
(Just to bring this topic to the top)
Regards.
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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
Thanks for your answer.
My problem tough is :
Suppose I have opened a Word-session manually and suppose I open a second Word-session through OLE in my FWH-application, how can I bring to top the right Word-session, i.e. the one which is opened by OLE ?
Until now I always have used this code :
The problem is that sometimes my manually opened Word-session is brought to top.
How can I solve this problem ?
My second question : how does this work with Excel or Outlook ?
Thanks.
Regards.
Thanks for your answer.
My problem tough is :
Suppose I have opened a Word-session manually and suppose I open a second Word-session through OLE in my FWH-application, how can I bring to top the right Word-session, i.e. the one which is opened by OLE ?
Until now I always have used this code :
Code: Select all
BringWindowToTop(FindWindow("OpusApp",NIL))
How can I solve this problem ?
My second question : how does this work with Excel or Outlook ?
Thanks.
Regards.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Michel,
Here you have a sample to manage Outlook from FWH. It steps through all events in the calendar. It will not create a Window:
Here you have a sample to manage Outlook from FWH. It steps through all events in the calendar. It will not create a Window:
Code: Select all
#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
Last edited by Antonio Linares on Thu Jun 12, 2008 7:09 am, edited 1 time in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Michel,
This code creates a new appointment in the calendar:
This code creates a new appointment in the calendar:
Code: Select all
#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 nil
Antonio,
Since I am visiting costumers for almost the whole day today, I'll come back to it tonight or tomorrow.
Thanks a lot.
Regards,
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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7