Sign in to follow this  
Followers 0
realshyfox

WordConstants UDF

1 post in this topic

#1 ·  Posted (edited)

Here I publish my WordConstants UDF. I hope it shall be usefull.

An example that uses Word constants from my UDF:

It inserts some blank pages.

#include<Word.au3>
#include<WordConstants.au3>
 
$oWord  = _WordCreate(@ScriptDir &"\Guide.doc", 0, 1)
$oDoc    = _WordDocGetCollection($oWord, 0)
$oDoc.Repaginate
 
$NumPages = _WordDocPropertyGet($oDoc, "pages")
$i=$NumPages
 
 
 
Do
    $i = $i - 1
    $oWord.Selection.GoTo($wdGotoPage, $wdGotoNext, 1)
    $oWord.Selection.InsertBreak($wdPageBreak)
 
Until $i = 1
    $oWord.Selection.EndKey($wdStory, $wdMove) ;updated script insert a new page at the end of the document
    $oWord.Selection.InsertBreak($wdPageBreak)
 
_WordDocSave ($oDoc)
_WordQuit ($oWordApp)

UDF File:

WordConstants.au3

Edited by realshyfox
1 person likes this

Learn, learn and ... learn

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  
Followers 0