Jump to content
Sign in to follow this  
Strydr

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

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!

Share this post


Link to post
Share on other sites

@Strydr
To use Word UDF, you need to have MS Office installed :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


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

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

Share this post


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

Share this post


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

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...