Jump to content
Sign in to follow this  
big_daddy

Microsoft Word Automation Library

Recommended Posts

Did you not see my post right before yours? I gave an example of how to print the entire document to the default printer.

yeah but u said i have to change 30 parameters

i thought ^P would be much easier and should work perfectly, control send doesnt make mistakes like send

Share this post


Link to post
Share on other sites

yeah but u said i have to change 30 parameters

i thought ^P would be much easier and should work perfectly, control send doesnt make mistakes like send

$oDoc.PrintOut ()

is that all i need?

Share this post


Link to post
Share on other sites

$oDoc.PrintOut ()

is that all i need?

All of those parameters are optional, but they give you the ability to control how and what the document prints. If all you need to do is print the entire document to the default printer, then the above example will work.

Share this post


Link to post
Share on other sites

Hi,

Looks good; ** Special request [cf post #2 in this thread]

Can you do my original reqyest too for this so I can use it instead of my others? [or is it already there]

I still use these a lot for that purpose; perhaps I can use yours early on if you get the runmacro going.

Best, Randall

Share this post


Link to post
Share on other sites

This is some great work BD...keep it up :whistle:


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

@doucment - Thank you! As for your question you need to provide more detail as to what exactly you are wanting. If the below example doesn't answer your question please start a new topic in the support forum.

#include <Word.au3>

$sFilePath = "Your file path"
$oWordApp = _WordCreate ($sFilePath)
$oDoc = $oWordApp.ActiveDocument
$sText = $oDoc.Range.Text
MsgBox(0, "Document Text", $sText)
_WordQuit ($oWordApp, 0)

Thanks,

Bob

Share this post


Link to post
Share on other sites

@chad.stout - Of course you can. I have been working on some concepts for find and replace. I plan on releasing a new version by the end of this weekend, so plan on that being one of the new features.

Share this post


Link to post
Share on other sites

Thanks for making the help file.

There is a typo in the instructions for using _WordDocAdd. "_WordQuit (...)" is used instead of _WordDocAdd (...)

#include <Word.au3>

_WordQuit ( ByRef $o_object [, $i_SaveChanges = -2 [, $i_OriginalFormat = 2 [, $b_RouteDocument = 0]]] )

-rjs

Share this post


Link to post
Share on other sites

Word.au3 and IE_T2.0_3.au3 and IE_T2.0_4.au3 contain the same Global contstant declaration (Global Const $LSFW_LOCK = 1, $LSFW_UNLOCK = 2).

Including Word.au3 and either of the IE_T2.0 libraries will generate a "Can not redeclare a constant" error message.

Commenting out the line in either library will solve the problem.

-rjs

Share this post


Link to post
Share on other sites

@jeff24 - Thanks, it will be fixed in the next release.

Sorry for the delayed release. I have the _WordDocFindReplace function complete, but I'm still trying to iron out a couple new functions.

Thanks,

Bob

Edit: I will also rename the Global Constant for the next release.

Edited by big_daddy

Share this post


Link to post
Share on other sites

New update available! See update history in first post for changes.

Enjoy,

Bob

p.s. The example for _WordPropertyGet is missing do to an error on my part. Should have an updated version of the help file posted soon.

Edit: Updated help file, thanks Jos!

Edited by big_daddy

Share this post


Link to post
Share on other sites

As you can see I'm open to suggestion/requests, so if there is functionality you would like to see be sure and let me know. I'm currently working on a Mail Merge function by request from some co-workers.

Thanks,

Bob

Share this post


Link to post
Share on other sites

Hi,

I am going in circles, i'm afraid;

What am I doing wrong here? (file already open in Word, selecting it again; should it not attach with a success?)

#include <Word.au3>
$sWordFile=FileOpenDialog("",@ScriptDir,"Doc files (*.doc)")
Local $o_Result = _WordAttach($sWordFile)

--> Word.au3 Warning from function _WordAttach, $_WordStatus_NoMatch

Best, Randall

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