TheDcoder Posted March 19, 2019 Author Posted March 19, 2019 5 minutes ago, water said: Can you please test for older/newer versions of MS Word (Word 2003 or Word 2007)? Is it okay if I test it using the 2019 version? That is the only version I have installed at the moment. I will be able to test this later tonight EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
water Posted March 19, 2019 Posted March 19, 2019 2019 is fine as well. 2003 would tell us if it works with the old .doc format as well 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
Bert Posted March 19, 2019 Posted March 19, 2019 Water - is it possible on save to simply select that version in word on save or the actual Word 2003 application is needed for testing? The Vollatran project My blog: http://www.vollysinterestingshit.com/
water Posted March 19, 2019 Posted March 19, 2019 Never tried, but I think you could manually start up Word 2003 and then run the script. _Word_Create connects to an already running Word instance. But you should check the task manager to make sure there is only a single instance before and after _Word_Create 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
Nine Posted March 19, 2019 Posted March 19, 2019 (edited) Tested it on 2003, not working... Test Word.au3 (25) : ==> COM Error intercepted ! err.number is: 0x80020006 err.windescription: Nom inconnu. err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 25 err.retcode is: 0x00000000 @error = 0x00000000, @extended = 0x00000000 Save is made in document folder not in script folder. GJ Water... Edited March 19, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
water Posted March 19, 2019 Posted March 19, 2019 The error you get is expected. Word 2003 uses method DocSaveAs whereas Word > 2007 uses method DocSaveAs2. The following lines first try to save for Word > 2007 and if an error occurs then it uses method DocSaveAs for Word <= 2007. That's why you see error "Nom inconnu" (Unknown name) for Word <= 2007. $oDoc.SaveAs2($sFileName, $iFileFormat, ...) ; Try to save for >= Word 2010 If @error = 0x80020006 Then $oDoc.SaveAs($sFileName, $iFileFormat, ...) ; COM error "Unknown Name" hence save for <= Word 2007 So it seems to work fine for older and newer version of MS Word The default folder is not what you and I expected (document folder instead of script folder). Seems the functions docu needs to be updated as well 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
TheDcoder Posted March 20, 2019 Author Posted March 20, 2019 @water Just tested with Microsoft Word 2016 (not 2019, oops ) and it works: @error = 0x00000000, @extended = 0x00000000 I can also find the Doc1.docx file under "My Documents" as mentioned by @Nine EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
Bert Posted March 20, 2019 Posted March 20, 2019 I have an old copy of word 2003 kicking around but here is a different question - seeing how that is 16 year old software and isn't even supported by MS, should we even be worried about dealing with an error like that? Thoughts? The Vollatran project My blog: http://www.vollysinterestingshit.com/
Nine Posted March 20, 2019 Posted March 20, 2019 50 minutes ago, Bert said: I have an old copy of word 2003 kicking around but here is a different question - seeing how that is 16 year old software and isn't even supported by MS, should we even be worried about dealing with an error like that? Thoughts? When it takes only one line of code to solve a problem (even on obsolete soft), I'd say "Why not" “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Earthshine Posted March 20, 2019 Posted March 20, 2019 (edited) well, you can be sure ms isn't going to be testing old retired software. count me in the why bother group. heck, most people in school only ever use google docs for everything. major universities, everything. nobody requires MS docs anymore. Not to say I don't love Office, I buy a family license for 365. I don't think I can ever give up office as we use it at work too. anyway, for all our products, we only test on the supported OSs. If customers must have old crap, they can pay us for support. Edited March 20, 2019 by Earthshine My resources are limited. You must ask the right questions
BrewManNH Posted March 20, 2019 Posted March 20, 2019 Schools/Colleges aren't the real world, as I'm sure you know. If the students aren't learning on Office products, they'll never make it in the job market. Any school that still uses Office pre Office 2010, you should send your kids elsewhere. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
water Posted March 20, 2019 Posted March 20, 2019 3 hours ago, Bert said: I have an old copy of word 2003 kicking around ... Thanks for your offer! @Nine has already tested with Excel 2003 and the solution that works for Excel > 2007 works for Excel <= 2007 as well. So there is no additional code for older versions to fix the problem reported by TheDcoder. Thanks to everyone for testing! I think I will fix code and docu in the near future TheDcoder 1 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