waldoo Posted November 18, 2009 Posted November 18, 2009 hello autoit community! this is my problem, i tried several things but i can't seem to get it to work: when i try to write some text into a word07 file i can't create a carriage return/line feed. all i get is some text or squares: $template = @ScriptDir & "\somefilewithastarinit.doc" $oWord = ObjCreate("Word.Application") $oWord.Visible = 1 $oWordDocuments = $oWord.Documents $oWordDocument = $oWordDocuments.Open($template) _WordDocFindReplace($oWordDocument,"*","line1" & @crlf & "line2" & @cr & "line3" & '<crlf>' & "line4" & 0x0D & 0x0A & "line5",1,0,0,1) results in a text in the word file looking like this: line1[][]line2[]line3<crlf>line41310line5 ([] here represents a square, as you see none of the four ideas works) as you can imagine, what i want is that: line1 line2 line3 line4 line5 i bet there's one autoit-guru out there who knows that...
water Posted November 18, 2009 Posted November 18, 2009 See the Remarks for Function _WordDocFindReplaceRemarks: "You can search for special characters by specifying appropriate character codes. For example, "^p" corresponds to a paragraph mark and "^t" corresponds to a tab character. You specify special characters and advanced search criteria just as you do for the Find argument." According to word a manual line feed is "^l". Hope this helps 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
waldoo Posted November 18, 2009 Author Posted November 18, 2009 great... this is exactly what i was looking for (in the last three hours...) ^^ thank you!
water Posted November 18, 2009 Posted November 18, 2009 Glad to be of service Just for the records:A list of codes can be found here. Paragraph "Codes for items you want to find and replace". 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
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