Jump to content

Word interaction query [solved]

Recommended Posts

Ok it's not strictly an Autoit question but it relates to using the word com object from my autoit prog.

I need to delete the contents of a word document and replace it with a short message.

I've tried playing with range.text but this doesn't include the tables etc., though it's fine for adding the message

The VBA would be something like

Selection.HomeKey Unit:=wdStory

or perhaps


How do i convert this to Autoit?

I'd thought something like

                 $oWordApp.ActiveDocument.Range.Text = "Cancelled by user "&@YEAR&@MON&@MDAY&@HOUR&@MIN&@SEC

The range.txt bit works on its own by replacing the old text with the message, but I can't get the same thing to work on the entire document - using wholestory in place of range.text just gives a com error.

Any suggestions, anyone?



Edited by saywell
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...