Can somebody help me out, finding why my code doesn't work ?
My code:
#b::
pwb := WBGet()
pTable:= pwb.document.GetElementsByTagName("Table") [4] ;outerHTML ;Set Tag name and Array value
Loop, % pTable.rows.length {
LSN:= pTable.rows[9] .GetElementsByTagName("TD") [1].outerHTML ; LSN
protocol:= pTable.rows[9] .GetElementsByTagName("TD") [3].outerHTML ; Protocol
Site:=pTable.rows[10] .GetElementsByTagName("TD") [1].outerHTML ; Site
Requisition:=pTable.rows[12] .GetElementsByTagName("TD") [3].outerHTML ; Requisition
subject= %protocol% , %LSN% , %site% , %Requisition%
;send the contents of subject into the subject of outlook
controlSend, RichEdit20WPT4, {end} , ahk_class rctrl_renwnd32 ;send to the end of the subject field
controlSendRaw, RichEdit20WPT4, %subject%, ahk_class rctrl_renwnd32 ; sent to the subject field
subject :="" ; empty the variable after process completed
return
} "
I want to send the variable subject= %protocol% , %LSN% , %site% , %requisition% to the the end of certain text in the subject field in my e-mail.
But I have 2 problems:
- I get the following in the subject field: <TD>SP005 VIABLE , 101999 , C277 , 103484490
How can I remove the TD ?
- I don't get the variable at the end of a certain text, but at the beginning of the text.
thus <TD>SP005 VIABLE , 101999 , C277 , 103484490 - Query discrepant info
Why ?
I thought that the following code would send the variable behind the certain text ?
controlSend, RichEdit20WPT4, {end} , ahk_class rctrl_renwnd32
Instead of:
Try:
Here's an explanation.
If that doesn't work you can try StringReplace:
As far as your code that is not sending your text to the End of you document try ControlFocus, ControlClick, and Sleep
etc..