I am using HTML in a dialog message box for a desk top application and would like to insert a variable in the message body. I cannot seem to figure it out.
Thanks!
Thanks!
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
email_ed.text= "<html><head> </head><body><div><P align=left\" class=style__1\"><p><FONT face=\"Tahoma\" style=\"font-size:10pt;color:#0000ff\"><br><br>The attached PDF file is for "+B_F_Name-" "+B_L_Name+" is being sent to "[COLOR=Red]+var->v_email_to+[/COLOR]".<br><br>"+Ln_off+"<br>"+title+"</p></div></body></body></html>"
dim global ht as C dim po_number as C po_number = "ABC123" ht = <<%strc% <html> <head> <meta name="generator" content="Alpha Five HTML Editor"> <title></title> <style> <!-- p { margin-top: 0; margin-bottom: 0 } --> </style> </head> <body> <p>PO Number: +PO_number</p></body></html> %strc% ht = strtran(ht,"+PO_number",var->po_number) 'Create an XDialog dialog box to prompt for parameters. DIM tst as P dim tst.object as p dim tst.class as c tst.class = "dhtmledit.dhtmledit" DIM SHARED varC_result as C DIM tst_html as c tst_html = var->ht 'Force the background color of the html text to be Win3D so that it blends in with the Xdialog box. dim win3dcolor as c win3dcolor = ui_color_format("win3d","#rhghbh") tst_html = a5_html_background(tst_html,win3dcolor) ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Alpha Five",<<%dlg% {startup=init} {region} | {activex=40,5tst?.f.}; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% if a_dlg_button = "init" then a_dlg_button = "" tst.object.browsemode = .t. tst.object.appearance = 0 tst.object.ScrollBars = .f. on error goto tst_error tst.object.documenthtml = tst_html on error goto 0 tst.object.Refresh() a_dlg_button = "" end if end tst_error: ui_msg_box("Error","Invalid URL or HTML content.",UI_STOP_SYMBOL) end %code%)
[COLOR="#FF0000"]dim shared vpo_number as C vpo_number = "ABC123"[/COLOR] 'Displays a message box (style:'OK Button', image: 'No symbol', id: 'a'). DIM SHARED a_result as N DIM SHARED a_OK_Button as L a_OK_Button = .F. title_var = "" message_text_var = <<%text% <html> <head> <meta name="generator" content="Alpha Five HTML Editor"> <title></title> <style> <!-- p { margin-top: 0; margin-bottom: 0 } --> </style> </head> <body> <p>PO Number: +PO_number</p></body></html> %text% [COLOR="#FF0000"]message_text_var = strtran(message_text_var,"+PO_number",vpo_number)[/COLOR] a_result=ui_html_msg_box(title_var,message_text_var,UI_OK+ UI_FIRST_BUTTON_DEFAULT+ UI_NO_SYMBOL,2,1,.f.,.t.,"inches","inches","Win3D") 'Test to see which button on the message box was pressed.... SELECT CASE a_result = UI_OK_SELECTED a_OK_Button= .t. END SELECT
'Displays a message box (style:'OK Button', image: 'No symbol', id: 'a'). DIM SHARED a_result as N DIM SHARED a_OK_Button as L a_OK_Button = .F. title_var = "PO Stamp" message_text_var = <<%text% <html> <head> <meta name="generator" content="Alpha Five HTML Editor"> <title></title> <style> <!-- p { margin-top: 0; margin-bottom: 0 } --> </style> </head> <body> [COLOR="#FF0000"]<p align=center>PO Number </p> <p align=center><strong><font size=5>+PO_Number</font></strong></p></body></html>[/COLOR] %text% message_text_var = strtran(message_text_var,"+PO_number",po_number.value) a_result=ui_html_msg_box(title_var,message_text_var,UI_OK+ UI_FIRST_BUTTON_DEFAULT+ UI_NO_SYMBOL,2,1,.f.,.t.,"inches","inches","Win3D") 'Test to see which button on the message box was pressed.... SELECT CASE a_result = UI_OK_SELECTED a_OK_Button= .t. END SELECT
Comment