Jump to content

how to copy one cell at a time from excel sheet and parse the data into outlook mail?


Go to solution Solved by water,

Recommended Posts

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hello Water,

Actually very new to Autoit, this  tool is fantastic and effective, since am developing script and getting stuck again and again, hence till i gets hands on i may contact you for some time, my current issue is that, i need to pull data which are marked in red in image attached whereas Auto windo info show class as "TPanel8" in that case what i need to do? how to get access to this data?

Export System.png

 

Link to comment
Share on other sites

What do you get when you try to read this control using Controlgettext?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hello Water,

Nothing, attached is the result

If WinExists('EXPORT') = True Then
    WinActivate('EXPORT')
    $TiTle = WinGetTitle('EXPORT')
 EndIf
  ;********************************************************************************************************************************************************************************
Local $ponum, $ponum1
Local $hWnd = WinGetHandle($TiTle, '')
For $i = 1 to 97
    Local $po1 = StringStripWS(ControlGetText($hWnd, '', "TEIEdit" & $i),8) ;getting the file number  
    Local $panel = StringStripWS(ControlGetText($hWnd, '', "TPanel8"),8) ;getting the file number   
    MsgBox(0, "Result", @error & " - " & $panel)
    If $po1 = "P/O" Then            
        $ponum = StringStripWS(ControlGetText($hWnd, '', "TEIEdit" & $i+1),8) ;getting the file number        
        $ponum1 = $ponum  & " " &$ponum1            
    EndIf   
Next

 

result.PNG

Link to comment
Share on other sites

That's what I feared. Panel controls are hard to access.
Another question: Does the product you try to automate provide a COM interface?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

With Control* functions you try to automate the GUI. If the program provides a COM interface you could automate it the way the Excel, Word and Outlook UDFs automate Office.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

System documentation?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

The guy who installed the application on your machine should know.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Dear Water,

I would like to add these notes below table, please advise how to do that?

Please note the following >>>>>

1. Carting allowed is Subject to Approval received from Consignee.

2. Kindly revert with transporter details i.e.Transporter name, LR number, driver name, vehicle number and license number.

3. Photocopy of the Lorry Receipt [LR] should be provided along with this carting order.

4. Clear Driver's Licence copy should be provided along with this carting order.

5. Please arrange to scan and submit copy of Duplicate GR / Form SDF / Measurement slip / Customs Attested Invoice within 48 hours after customs clearance.

6. Cartons should arrive and be offloaded / carted in a sorted condition. Also cartons should be sorted serial number wise for every Invoice before the shipment is accepted ready by Expeditors

7. Partial shipments are not allowed to be carted at the CFS.

8. Ensure that the cargo arrives in full quantity as described / mentioned on the Invoice & Packing List.

9. Carting order is valid for only 2 days from date of issuance.

10. Cargo Carting will be allowed only upto 1800 hrs, every evening.

11.Carting issued subject to receipt of OMB Booking

 

Global $subject,$Eihb,$ssubject1,$sReference,$EiRef,$sVessel,$sHAWB,$onhandnmbr,$omnmbr,$cfs,$cfs1,$point,$point1,$ctc,$ctc1,$chb,$chb1,$cnee1,$voyage,$etd,$custom,$inv,$pos,$pkgs   
Sleep(100)
#include <OutlookEX.au3>
Global $sshpordr = "Ship order no."
Global $onhandnmbr = "Onhand no."
Global $omnmbr = "OMB Booking No."
Global $var1 = "K2C29653"
Global $sVessel = "Planned Vessel"
Global $sHAWB = "HAWB-Value"
Global $ssubject1 = "Carting Order"
Global $subject = $Eihb  & " " &$ssubject1
Global $Eihb   = "H13318666"
Global $EiRef   = "812933184"
Global $cfs   = "Carting CFS" 
Global $cfs1   = "Ameya Logistics Pvt. Ltd" 
Global $point   = "Carting Point" 
Global $point1   = "Ameya Logistics Pvt. Ltd A/C Expeditors Shed - 3" 
Global $ctc   = "Contact Person" 
Global $ctc1   = "Sudhir Patil @ AMEYA" 
Global $chb   = "CHB" 
Global $chb1   = "" 
Global $hpr1   = "Shipper" 
Global $cnee1   = "Consignee" 
Global $voyage   = "Voy #" 
Global $etd   = "ETD" 
Global $custom   = "Customs Cleared Cargo cut off" 
Global $final   = "Final Destination" 
Global $pos   = "P/O#" 
Global $inv   = "INV NO." 
Global $pkg   = "Pkgs" 
; Create table
Global $sStyle = "<style>table, td { border: 1px solid black; border-collapse: collapse}</style>"
Global $sBody = $sStyle &"<Table> <TR><TD>" & $sshpordr & "<TD>" & $var  & "</TD>" &"</TD></TR>" & "<TR><TD>" & $onhandnmbr & "<TD>" & $onhand& "</TD>" & "</TR></TD>" & "<TR><TD>" & $omnmbr & "<TD>" & $iomb & "</TD>" & "</TD></TR>" & "<TR><TD>" & $cfs & "<TD>" & $cfs1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $point & "<TD>" & $point1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $ctc & "<TD>" & $ctc1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $chb & "<TD>" & $chb1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $hpr1 & "<TD>" & $shpr & "</TD>" & "</TD></TR>" & "<TR><TD>" & $cnee1 & "<TD>" & $cnee & "</TD>" & "</TD></TR>"& "<TR><TD>" & $sVessel & "<TD>" & $vsl1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $voyage & "<TD>" & $voy1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $etd & "<TD>" & $bkd1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $custom & "<TD>" & $lrd1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $final & "<TD>" & $dlv  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $pos & "<TD>" & $ponum1  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $inv & "<TD>" & $invnum1  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $pkg & "<TD>" & $pkgs  & "</TD>" & "</TD></TR></TABLE>"
; Create the item
Global $oOutlook =  _OL_Open()
Global $oItem = _OL_ItemCreate($oOutlook, $olMailItem)
If @error <> 0 Then Exit MsgBox(16, "Outlook", "Error creating the mail item. @error = " & @error & ", @extended = " & @extended)
; Set mail format to HTML
_OL_ItemModify($oOutlook, $oitem, Default, "BodyFormat=" & $olFormatHTML)
; Retrieve signature
$oItem.GetInspector
$sSignature = $oItem.HTMLBody
; Set Body to text plus signature
$oItem.HTMLBody = $sBody & $sSignature
$oItem.Display
_OL_ItemModify($oOutlook, $oitem, Default, "BodyFormat=" & $olFormatHTML, "Subject=" & $subject)
_OL_ItemRecipientAdd($oOutlook,$oItem, Default, $olTo, $sCellValue)
 _OL_ItemRecipientAdd($oOutlook, $oItem, Default, $olCc, $sCellValue)
_OL_ItemSend($oOutlook,$oItem)

 

Link to comment
Share on other sites

That's easy. Your browser has a function to display the source of the displayed page. Search for "please note the following" and you will see how it looks like in HTML.
Source.png

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hello Water,

Am getting attached error, is this right way to incorporate?

Global $sBody = $sStyle &"<Table> <TR><TD>" & $sshpordr & "<TD>" & $var  & "</TD>" &"</TD></TR>" & "<TR><TD>" & $onhandnmbr & "<TD>" & $onhand& "</TD>" & "</TR></TD>" & "<TR><TD>" & $omnmbr & "<TD>" & $iomb & "</TD>" & "</TD></TR>" & "<TR><TD>" & $cfs & "<TD>" & $cfs1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $point & "<TD>" & $point1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $ctc & "<TD>" & $ctc1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $chb & "<TD>" & $chb1 & "</TD>" & "</TD></TR>" & "<TR><TD>" & $hpr1 & "<TD>" & $shpr & "</TD>" & "</TD></TR>" & "<TR><TD>" & $cnee1 & "<TD>" & $cnee & "</TD>" & "</TD></TR>"& "<TR><TD>" & $sVessel & "<TD>" & $vsl1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $voyage & "<TD>" & $voy1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $etd & "<TD>" & $bkd1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $custom & "<TD>" & $lrd1 & "</TD>" & "</TD></TR>"& "<TR><TD>" & $final & "<TD>" & $dlv  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $pos & "<TD>" & $ponum1  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $inv & "<TD>" & $invnum1  & "</TD>" & "</TD></TR>"& "<TR><TD>" & $pkg & "<TD>" & $pkgs  & "</TD>" & "</TD></TR></TABLE>"
<p>
<span lang="en-us" sytle="font-family:Arial, sans-serif;color:#000080;"xml:lang="en-us">Please note the following &gt;&gt;&gt;&gt;&gt;<br/br/>
1. hello</span><span lang="eng-us" style="fond=size:12pt;font-family:'Times New Roman',serif;"xml:lang="en-us"></span></p>
<p></p>

 

Error.PNG

Link to comment
Share on other sites

No ;)
The HTML code needs to be inside quotes like any other string.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Come on, that's not too hard to put some quotes around the HTML code and concatenate with $sBody :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Replace space with "&nbsp;"
Example: "Test file" becomes "Test&nbsp;file"

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...