Hi there!
I'm making a script for automating the creation of a word document.
#include <Word.au3>
Local $oWord = _Word_Create()
$currentQuestion = 0
$oDoc = _Word_DocAdd($oWord)
$oRange = _Word_DocRangeSet($oDoc, -1, $wdParagraph, 1, Default, 2)
$oRange.Font.Name = "Calibri"
$oRange.Font.Size = 14
$oRange.InsertAfter("Document Title" & @CR & @CR & @CR)
$oRange.Font.Bold = True
$listRange = _Word_DocRangeSet($oDoc, -2)
For $i = 1 To 3
$oRange = _Word_DocRangeSet($oDoc, -2)
$oRange.InsertAfter("Category " & $i & @CR)
$oRange.Font.Bold = True
$listRange &= _Word_DocRangeSet($oDoc, -2)
$oRange = _Word_DocRangeSet($oDoc, -2)
For $n = 1 To 3
$oRange.InsertAfter("___________________________________" & @CR)
Next
$oRange.ListFormat.ApplyNumberDefault
$oRange.InsertAfter(@CR)
$oRange.Font.Bold = False
Next
This is just a test, later the script will fetch the categories and lines from different text files but that's irrelevant.
I've managed to paste this together by looking at the MSDN site for Word VBA, but I must confess that I'm kind of lost when it comes to working with objects using AutoIt.
I want the numbered lists to keep counting from the previous list, right now they start over from 1 in every category.
This is what I get when I run my script:
____________________________________________________________________________________________________________________________________
This is what I want :