Jump to content
Sign in to follow this  
sambuddy

Trouble using the "Word Management" UDF's

Recommended Posts

sambuddy

Hello All,

I am trying to use the _Word UDF's but i seem to be missing something. I am trying to use these word functions to create a log file for some tests i am automating. My intention is to add some text to a document and then add a graphic and then add some more text and then add another graphic etc etc. So i have written this code below, but it places the graphic before the text. I get the feeling i need to tell it where to place the cursor before i do any opperation, but i havent worked it out. Can anyone can point me in the right direction?

Thanks

#include <Word.au3>

$log=_WordCreate("");create an instance of word

$oDoc=_WordDocAdd($log,1);create a blank html document

$oDoc.Range.InsertBefore("This is some text to insert.");these two lines have the same effect

$oDoc.Range.InsertAfter("This is some text to insert.");these two lines have the same effect

_WordDocAddPicture($oDoc,"C:\ocr_test.bmp",0,1);insert my graphic

_WordDocSaveAs($oDoc,"C:\log",9);save the file

_WordQuit($log,-1);close word

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  

×