Skip to main content

Who can help me? I want to send automatically without Intervention of the operator an Email from my program with NETEXPRESS 5.1.

I prepare the mail with

          invoke MessageObj "SetTo"  using PARA-MAIL .

         invoke MessageObj "SetSubject" using ASUNTO-MAIL .

       invoke messageObj "setHTMLBody" using MENSAJE-O.

with no problems.

 

          invoke messageobj "send".

works perfectly, but only if my OUTLOOK is running previously.

If it is not running I get an OleException.

 

How can I test if OUTLOOK is running and, if not ,make run any version of OUTLOOK from my program?

 

I tried

002841    STRING 'START OUTLOOK'

or

002841     STRING 'OUTLOOK'

002844         x"00" DELIMITED BY SIZE

002845         INTO CmdLine,

002846       move 1 to CmdShow,

002852     call winapi "WinExec"

002853         using by reference CmdLine

002854               by value     CmdShow

002855        returning          CmdStatus.

 

But receive always a CmdStatus   of 512 and OUTLOOK does not Run..

 

Who can help me?

Thenks

Rolf

 

Who can help me? I want to send automatically without Intervention of the operator an Email from my program with NETEXPRESS 5.1.

I prepare the mail with

          invoke MessageObj "SetTo"  using PARA-MAIL .

         invoke MessageObj "SetSubject" using ASUNTO-MAIL .

       invoke messageObj "setHTMLBody" using MENSAJE-O.

with no problems.

 

          invoke messageobj "send".

works perfectly, but only if my OUTLOOK is running previously.

If it is not running I get an OleException.

 

How can I test if OUTLOOK is running and, if not ,make run any version of OUTLOOK from my program?

 

I tried

002841    STRING 'START OUTLOOK'

or

002841     STRING 'OUTLOOK'

002844         x"00" DELIMITED BY SIZE

002845         INTO CmdLine,

002846       move 1 to CmdShow,

002852     call winapi "WinExec"

002853         using by reference CmdLine

002854               by value     CmdShow

002855        returning          CmdStatus.

 

But receive always a CmdStatus   of 512 and OUTLOOK does not Run..

 

Who can help me?

Thenks

Rolf

 

You can start outlook with a ShellExecute

          call WINAPI ShellExecute using

               by value 0 size 4,

               by value 0 size 4,

               by reference z"outlook.exe"

               by value 0 size 4,

               by reference

               Z"C:\\Program Files\\Microsoft Office 15\\root\\office15\\"  

               by value SW-hide

               returning se-hInstance

          end-call

Regards Georg


Who can help me? I want to send automatically without Intervention of the operator an Email from my program with NETEXPRESS 5.1.

I prepare the mail with

          invoke MessageObj "SetTo"  using PARA-MAIL .

         invoke MessageObj "SetSubject" using ASUNTO-MAIL .

       invoke messageObj "setHTMLBody" using MENSAJE-O.

with no problems.

 

          invoke messageobj "send".

works perfectly, but only if my OUTLOOK is running previously.

If it is not running I get an OleException.

 

How can I test if OUTLOOK is running and, if not ,make run any version of OUTLOOK from my program?

 

I tried

002841    STRING 'START OUTLOOK'

or

002841     STRING 'OUTLOOK'

002844         x"00" DELIMITED BY SIZE

002845         INTO CmdLine,

002846       move 1 to CmdShow,

002852     call winapi "WinExec"

002853         using by reference CmdLine

002854               by value     CmdShow

002855        returning          CmdStatus.

 

But receive always a CmdStatus   of 512 and OUTLOOK does not Run..

 

Who can help me?

Thenks

Rolf

 

Thank you for the sugestions.  Making the following changes it works perfect:

000008     call-convention 66 is winapi.   *>    74 does not link

          CALL winapi "ShellExecuteA" using          *> the quptation and  A   is necesary

     *        Z"C:\\Program Files\\Microsoft Office 15\\root\\office15\\"        can be replaced by

              by value 0 size 4   *> sin path

     *       by value SW-hide                I replaced by value  7

              by value 7  *>CmdShow

Thanks for the help

Rolf


Who can help me? I want to send automatically without Intervention of the operator an Email from my program with NETEXPRESS 5.1.

I prepare the mail with

          invoke MessageObj "SetTo"  using PARA-MAIL .

         invoke MessageObj "SetSubject" using ASUNTO-MAIL .

       invoke messageObj "setHTMLBody" using MENSAJE-O.

with no problems.

 

          invoke messageobj "send".

works perfectly, but only if my OUTLOOK is running previously.

If it is not running I get an OleException.

 

How can I test if OUTLOOK is running and, if not ,make run any version of OUTLOOK from my program?

 

I tried

002841    STRING 'START OUTLOOK'

or

002841     STRING 'OUTLOOK'

002844         x"00" DELIMITED BY SIZE

002845         INTO CmdLine,

002846       move 1 to CmdShow,

002852     call winapi "WinExec"

002853         using by reference CmdLine

002854               by value     CmdShow

002855        returning          CmdStatus.

 

But receive always a CmdStatus   of 512 and OUTLOOK does not Run..

 

Who can help me?

Thenks

Rolf

 

Your changes are ok, but I define the api-calls and references like this:

    $set constant UNICODE (0)

    $IF UNICODE = 0

     78 Suffix                value "A".

    $ELSE

     78 Suffix                value "W".

    $END

     78 ShellExecute                       value "ShellExecute" & Suffix.

     78 GetCurrentDirectory           value "GetCurrentDirectory" & Suffix.

     78 GetUserName                      value "GetUserName" & Suffix.

     78 GetComputerName             value "GetComputerName" & Suffix.

     78 CreateProcess                     value "CreateProcess" & Suffix.

     78 WaitForSingleObject            value "WaitForSingleObject".

     78  SW-HIDE                               value           0.

     78  SW-SHOWMINNOACTIVE  value           7.

      01 int      is typedef pic s9(SZ) comp-5.

      01 HINSTANCE is typedef int.

      01 se-hInstance     HINSTANCE.

and so on.

regards

Georg