FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OLE, Word and Outlook
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
OLE, Word and Outlook
Posted: Sat Apr 15, 2017 02:10 PM
Hello,

I use this code to position Word on my screen:
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: OLE, Word and Outlook
Posted: Tue Apr 18, 2017 08:44 AM

Nobody?

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

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: OLE, Word and Outlook
Posted: Mon Jul 17, 2017 01: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 (fw): Select all Collapse
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: <!-- m --><a class="postlink" href="https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/oldefaultfolders-enumeration-outlook">https://msdn.microsoft.com/en-us/vba/ou ... on-outlook</a><!-- m -->
    oExplorer := oOutlook:Explorers():Add(oInbox, 0) // Enumeration: <!-- m --><a class="postlink" href="https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.olfolderdisplaymode.aspx">https://msdn.microsoft.com/en-us/librar ... ymode.aspx</a><!-- m -->
    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

Continue the discussion