Jump to content
gauravvogue

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

Recommended Posts

 

Hello  Water


I just used you wrapper script, 
intend to reade the  
- email address
- email subject
- email body

from the excel  ....

anyway i have some problem, i found that when the email body exceed than 256 character
then the email body will be blank !!!


while the short message the code below are working fine,  

any suggestion ???  Thank you very much 


Regards
Ron

 

#include<excel.au3>
#include <OutlookEX.au3>

;Local $sString = String(10)

$i = 0
While $i <= 2
;   MsgBox(0, "Value of $i is:", $i)
$i = $i + 1

Local $Open_Excel = _Excel_Open()
Local $File_Path = "D:\autoit\email_list.xlsx"
Local $Open_WorkBook = _Excel_BookOpen($Open_Excel,$File_Path)
WinActivate($Open_WorkBook)
Local $Read_Excel_address = _Excel_RangeRead($Open_WorkBook,Default,"A"&$i)
Local $Read_Excel_Subject = _Excel_RangeRead($Open_WorkBook,Default,"B"&$i)
Local $Read_Excel_MailBody = _Excel_RangeRead($Open_WorkBook,Default,"C"&$i)

_Excel_Close($Open_Excel, False)

Global $oOutlook = _OL_Open()
Global $bodyvar = $Read_Excel_MailBody
Global $recipientAddress = $Read_Excel_address
Global $subjectvar = $Read_Excel_Subject
_OL_Wrapper_SendMail($oOutlook, $recipientAddress, "", "", $subjectvar, $bodyvar)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended)

Wend

 

Share this post


Link to post
Share on other sites

According to the help file there is a solution :)

Quote

The Excel transpose method doesn't support cells with more than 255 characters. Set $bForceFunc = True to bypass this limitation(s).

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-11-30 - Version 1.4.0.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-11-30 - Version 1.4.0.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
On ‎1‎/‎29‎/‎2018 at 5:28 AM, water said:

$bForceFunc = True

Thanks a lot Master.

It solved my issue too.

Regards,

Share this post


Link to post
Share on other sites

:) 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-11-30 - Version 1.4.0.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

×
×
  • Create New...