Verifying the outlook version

Jefferson.sn

New Member
Hello everybody,
Would like to know, is there some way to check the version or if it is available of the outlook?


Code:
    DEFINE VARIABLE m-objOutlook    AS COM-HANDLE      NO-UNDO.
    DEFINE VARIABLE m-objoutlookMsg AS COM-HANDLE      NO-UNDO.
DEF            VAR i-pathdoc     AS CHAR                     NO-UNDO.
DEF            VAR i-prefixo     AS CHAR                     NO-UNDO.
DEF            VAR i-coddoc      AS INT                     NO-UNDO.
DEF            VAR i-ndoc        AS INT                     NO-UNDO.


i-pathdoc = "C:\tmp".
i-prefixo = "Teste".
i-coddoc  = 1  .
i-ndoc    = 001 .


    CREATE "Outlook.Application" m-objOutlook NO-ERROR.
    IF ERROR-STATUS:ERROR THEN DO:
        MESSAGE "An error occurred when instantiating Outlook!" SKIP
                "The email was not sent!"
            VIEW-AS ALERT-BOX INFO TITLE "My Company Name".
        RETURN NO-APPLY.
    END.
    
    ASSIGN m-objoutlookMsg         = m-objOutlook:CreateItem(0)
           m-objOutlookMsg:Subject = "Renda - Relatórios\Notas Sistema Renda Fixa \SWAP - Renda Fixa\SWAP: "
           m-objOutlookMsg:Body    = "Just another test".
    
    m-objOutlookMsg:Recipients:ADD("jefferson.nascimento@crk.com.br").
    m-objOutlookMsg:attachments:ADD(i-pathdoc + "\" + i-prefixo + STRING(i-coddoc,"999999") + ".pdf").
    
    m-objOutlookMsg:DISPLAY(0)  NO-ERROR.
    
    RELEASE OBJECT m-objOutlookMsg    NO-ERROR.
    RELEASE OBJECT m-objOutlook       NO-ERROR.
 
To check the version i've found the solution.
Code:
/* Office 2007 */
IF INTEGER(excelAPP:version) >= 12 THEN 
    display "office 2007".
But one doubt , how can i call the outlook express if the client doesn't have a outlook 2007 installed on his machine?
 
Back
Top