jimmy123j Posted October 4, 2018 Posted October 4, 2018 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
Moderators JLogan3o13 Posted October 4, 2018 Moderators Posted October 4, 2018 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!
jimmy123j Posted October 4, 2018 Author Posted October 4, 2018 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 But the body always like
water Posted October 4, 2018 Posted October 4, 2018 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 2024-07-28 - Version 1.6.3.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 (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
jimmy123j Posted October 5, 2018 Author Posted October 5, 2018 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 = ="
water Posted October 5, 2018 Posted October 5, 2018 If you can manage to create HTML for everything and then set property HTMLBody ... My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
macran Posted October 9, 2024 Posted October 9, 2024 TRY: 12= length("hello world!") $oItem.Getinspector.Wordeditor.Range(12).Paste
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now