OLE, Word and Outlook

OLE, Word and Outlook

Postby driessen » Sat Apr 15, 2017 2:10 pm

Hello,

I use this code to position Word on my screen:
Code: Select all  Expand view
oWord:Top    := US->UWORDTOP
oWord:Left   := US->UWORDLEF
oWord:Width  := US->UWORDWID
oWord:Height := US->UWORDHEI
I also us this code to make Word visible:
Code: Select all  Expand view
oWord:Visible := .T.
This is also working likewise for Excel.

But why isn't it working for Outlook? How can I postion my Outlook on my screen in FWH?

Thanks a lot in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: OLE, Word and Outlook

Postby driessen » Tue Apr 18, 2017 8:44 am

Nobody?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: OLE, Word and Outlook

Postby gkuhnert » Mon Jul 17, 2017 1:31 pm

There simply is no Application.Visible property implemented by Microsoft. You just have to define an explorer. For example, if you want to show the inbox folder in Outlook you could implement:

Code: Select all  Expand view
static function ShowInbox()
local oNameSpace, oInbox
local oExplorer
    oOutlook := GetOutlookObject()
    IF oOutlook == nil
        return {}
    ENDIF
    oNameSpace := oOutlook:Get( "GetNameSpace", "MAPI" )
    oInbox := oNameSpace:Get( "GetDefaultFolder", 6 ) // Enumeration: https://msdn.microsoft.com/en-us/vba/ou ... on-outlook
    oExplorer := oOutlook:Explorers():Add(oInbox, 0) // Enumeration: https://msdn.microsoft.com/en-us/librar ... ymode.aspx
    oExplorer:Activate()
return nil

static function GetOutlookObject()
local oOutlook
    TRY
        oOutlook := GetActiveObject ( "Outlook.Application" )
    CATCH
        TRY
        oOutlook := CREATEOBJECT( "Outlook.Application" )
        CATCH
                MsgStop("Cannot start outlook!")
                return .f.
            END
        END
    ENDIF
return oOutlook
 


Properties Top, Left, Height and Width are available to the explorer-object:
https://msdn.microsoft.com/VBA/Outlook- ... ct-outlook
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 18 guests