Jump to content

getinspector.wordeditor.range.paste will overwrite the body in Outlook


Recommended Posts

I script the auto mail by OutlookEX, and need to copy the Excel range into Outlook body

But used the getinspector.wordeditor.range.paste will overwrite the body

And getinspector.wordeditor.range.collapse($wdCollapseEnd) or .collapse(0) no response

I used the OutlookEX create Outlook item by the way

'cause the company security (IT lock the upload system), I can' upload and file, even answer the post, sorry

 

Link to comment
Share on other sites

  • Moderators
12 minutes ago, jimmy123j said:

'cause the company security (IT lock the upload system), I can' upload and file, even answer the post, sorry

 

If you cannot post your script then you are out of luck, our last crystal ball just went into the shop. You mention in your title copying an Excel range but then state you are using getinspector.wordeditor functions. If you are copying out of excel you should be using the _Excel_* functions (look in the help file). Beyond that, without seeing your script it is pretty much impossible to help you fix it.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

22 minutes ago, JLogan3o13 said:

If you cannot post your script then you are out of luck, our last crystal ball just went into the shop. You mention in your title copying an Excel range but then state you are using getinspector.wordeditor functions. If you are copying out of excel you should be using the _Excel_* functions (look in the help file). Beyond that, without seeing your script it is pretty much impossible to help you fix it.

 

I script at my company, my code almost like this

$oExcel = _Excel_Open()
$oWorkbook = _Excel_BookOpen ($oExcel, "D:\Desktop\123.xlsx")
$oWorkbook.Sheets(1).UsedRange.Copy
_Excel_Close($oExcel, False)

$oOutlook = _OL_Open()
$oItem = _OL_ItemCreate($oOutlook, $olMailItem)
$oItem.To = "ABC@123.com"
$oItem.CC = ""
$oItem.Subject = "Auto Mail Testing"
$oItem.HTMLBody = "Hello World,"
$oItem.Getinspector.Wordeditor.Range.InsertParagraphAfter()
$oItem.Getinspector.Wordeditor.Range.Collapse($wdCollapseEnd)
$oItem.Getinspector.Wordeditor.Range.Paste
$oItem.Display

 

I hope the mail body can be

image.png.88631f0a765787118a55569dd52f9cc7.png 

 

But the body always like

image.png.867a03ccbed8c120725fa6e681e9cc77.png

 

Link to comment
Share on other sites

I suggest to use the Word editor to create the full mail body including ‚Hello world‘

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

9 hours ago, water said:

I suggest to use the Word editor to create the full mail body including ‚Hello world‘

Thank you water, it's work to me

But any possible to use the Outlook only ?

I mean I don't like to use excel to word, then to outlook, that's complex  = ="

Link to comment
Share on other sites

If you can manage to create HTML for everything and then set property HTMLBody ...

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...