timepro timesheet
unread,Jul 15, 2021, 5:18:43 AM7/15/21You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
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 ...