• ("Outlook.Application")

    From timepro timesheet@21:1/5 to All on Thu Jul 15 02:18:42 2021
    hello all:

    at some endusers my app crashes at line#28.
    but, at most users, that exact same app works fine.

    tia

    ***********
    func oemail(o1)
    ***********
    1 o1=if(empty(pcount()),'O',o1)
    2 if upper(substr(os(),9,2))='XP'.or.upper(substr(os(),9,2))='VI'
    3 message('works under win7/8/10')
    4 end
    5 toto=if(empty(toto),alltrim(client->clientst),toto)
    6 tsubject=if(!empty(tsubject),tsubject,'PFA')
    7 attch=pdfname && e.g.: diskname()+':\tax\gst\A001clientbills21-22.pdf' 8 tbody=if(empty(tbody),trim(client->clientname),tbody)
    9 tbody1=if(empty(tbody1),trim(client->clientadr1)+', '+trim(client->clientadr2),tbody1)
    10 tbody2=if(empty(tbody2),trim(client->clientcity),tbody2)
    11 tbody+="<br>"+tbody1+"<br>"+tbody2
    12 email=.t.
    13 TRY
    14 oOutlook:=GetActiveObject("Outlook.Application")
    15 oOutlook:=CreateObject("Outlook.Application")
    16 CATCH
    17 dcr(23,01,24,79,xw)
    18 mymess(23,39,'outlook application not installed/activated in this system',xm,xy,fcn,6,6,900)
    19 mymess(24,39,'app may crash',xm,xy,fcn,6,6,900);inkey(.5);inkey(15)
    20 email=.f.
    21 END
    22 if email
    23 oMsg:=oOutlook:CreateItem(0)
    24 oMsg:GetInspector()
    25 oMsg:TO := toTO
    26 oMsg:Subject := tSubject
    27 oMsg:HTMLBody := tbody
    28 if !empty(attch);oMsg:Attachments:add(Attch);end && CRASHES HERE (attch is never empty)
    29 oMsg:Display(.f.)
    30 end
    31 ...
    32 ...
    33 ...
    34 ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ella Stern@21:1/5 to timec...@gmail.com on Thu Jul 15 04:46:28 2021
    https://docs.microsoft.com/en-US/outlook/troubleshoot/performance/outlook-not-responding-error-or-outlook-freezes

    On Thursday, July 15, 2021 at 12:18:43 PM UTC+3, timec...@gmail.com wrote:
    hello all:

    at some endusers my app crashes at line#28.
    but, at most users, that exact same app works fine.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Reinaldo@21:1/5 to Ella Stern on Thu Jul 15 08:21:21 2021
    How about testing if Attch is Nil?

    Reinaldo.

    On Thursday, July 15, 2021 at 7:46:29 AM UTC-4, Ella Stern wrote:
    https://docs.microsoft.com/en-US/outlook/troubleshoot/performance/outlook-not-responding-error-or-outlook-freezes
    On Thursday, July 15, 2021 at 12:18:43 PM UTC+3, timec...@gmail.com wrote:
    hello all:

    at some endusers my app crashes at line#28.
    but, at most users, that exact same app works fine.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to Reinaldo on Sun Jul 18 22:25:23 2021
    On Thursday, July 15, 2021 at 8:51:22 PM UTC+5:30, Reinaldo wrote:
    How about testing if Attch is Nil?

    Reinaldo.
    On Thursday, July 15, 2021 at 7:46:29 AM UTC-4, Ella Stern wrote:
    https://docs.microsoft.com/en-US/outlook/troubleshoot/performance/outlook-not-responding-error-or-outlook-freezes
    On Thursday, July 15, 2021 at 12:18:43 PM UTC+3, timec...@gmail.com wrote:
    hello all:

    at some endusers my app crashes at line#28.
    but, at most users, that exact same app works fine.


    Attch is not nil.
    if !empty(attch);oMsg:Attachments:add(Attch);end && CRASHES HERE (attch is never empty)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to All on Tue Jul 20 03:51:18 2021
    if !empty(attch);oMsg:Attachments:add(Attch);end && CRASHES HERE

    earlier code
    pdfname='\tax\pdffiles\'+pdfname
    but after i added diskname() [pdfname=diskname()+':\tax\pdffiles\'+pdfname ] it works fine...

    is diskname() mandatory, even if the app (exe) is residing in C:\TAX and outlook is also installed in C:

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From CV@21:1/5 to All on Tue Jul 20 12:44:05 2021
    El martes, 20 de julio de 2021 a la(s) 07:51:19 UTC-3, timec...@gmail.com escribió:
    if !empty(attch);oMsg:Attachments:add(Attch);end && CRASHES HERE
    earlier code
    pdfname='\tax\pdffiles\'+pdfname
    but after i added diskname() [pdfname=diskname()+':\tax\pdffiles\'+pdfname ] it works fine...

    is diskname() mandatory, even if the app (exe) is residing in C:\TAX and outlook is also installed in C:

    thanks

    hi

    It needs to use a fully qualified pathname like drive:\directory\subdir\file.ext as in C:\Temp\MyDir\MyPdf.pdf

    Regards
    Claudio Voskian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)