Jump to content

Cannot create a Word Object: do I need to buy MS Word first?


Strydr
 Share

Recommended Posts

I'm trying to figure out how to work with the word.au3 udf but it's not working.  Every example I attempt to run errors out with  "Error creating a new Word application object.  @error = 1, @extended=-2147221005"

Running Windows10 and the latest version of Autoit.

I had the impression that this would work on Windows with Wordpad documents, and that MS Word does not need to be installed.  Do I actually need to buy and install MS Word?  A LOT of people don't buy MS Office or MS Word, so I'm hoping that this is not the case.

Thanks!

Link to comment
Share on other sites

The UDF automates MS Word by interacting with Word through COM.
Hence: You need to install MS Word to use the Word UDF ;)

How did you get the impression that the Word UDF works with Wordpad?

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

 

Link to comment
Share on other sites

Crepes!  Thank you!  That really needs to be commented into the udf or posted somewhere!  I never came across anything stating that!

-I came across the idea that it would work without having Word installed by searching for "autoit format documents".  

The only references I'm coming across for formatting documents all end at the Word udf.  I can't find any formatting info that doesn't involve it. And NONE of the references mention the need to actually have Word installed.

Edit: I came across a reference to using Excel for this but I knew that the user would need to buy and install it, but it never occurred to me that the same thing might be the case for Word.  Doh!

This is driving me nuts!  I just want to add basic formatting to a document: the type of document isn't even important, it can be anything that will take formatting! And print from there of course.  But the assumption has to be that the user just has Windows, no extra programs.

O well, back to the drawing board.  At least I can stop chasing this particular tail!

Edited by Strydr
Link to comment
Share on other sites

When you have a look at the UDF page in the wiki you might find a tool that suits your needs :)
Maybe creating a PDF from your appplication is an option:

 

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

 

Link to comment
Share on other sites

18 hours ago, Strydr said:

  A LOT of people don't buy MS Office or MS Word, so I'm hoping that this is not the case.

Have a look at the RichTextFormat functions.  It's not exactly Word, but very versatile.

eg https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlRichEdit_Create.htm

Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Working with that now.  Atm, I'm having an issue with the fact that it uses variable width formatting.  In other words, different letters take up different amounts of space.  So if you have 2 different sentences with the same number of characters, they will actually be different lengths.  Makes formatting anything afterwords... challenging.  I'm open for ideas if anyone has one.  In particular, I'd love to be able to turn that off so that each character takes the same amount of space.  Any thoughts?

Thank you!

Edit: well, one way to fix it is to change the font to 'Fixedsys'.

Edit2: but that won't print properly.  Interesting.

Edited by Strydr
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...