Jump to content
Sign in to follow this  
jimmy123j

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

 

Share this post


Link to post
Share on other sites
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!

Share this post


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

 

Share this post


Link to post
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 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
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 (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


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

Share this post


Link to post
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 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
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 (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - 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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...