Sign in to follow this  
Followers 0
broliukaz

MS Word table next line

1 post in this topic

It's so simple code, but I'm stuck! :D

How can I enter next line in the word table?

with "@CRLF" it creates new row, but not next line in the table  :(

I'm using MS Word 2013 (32bit)

#include <Word.au3>
#include <WordConstants.au3>

Local $EQAddress = FileRead(@ScriptDir&"\Address.txt")
Local $Rivona = FileRead(@ScriptDir&"\Rivona.txt")

; Create application object
Local $oWord = _Word_Create()
If @error Then Exit MsgBox(0,"ERROR","Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
; Open the test document
Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\Extras\Test.doc", Default, Default, True)
If @error Then Exit MsgBox(0,"ERROR","Error opening '.\Extras\Test.doc'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

; *****************************************************************************
; Write the content of a 0-based two dimensional array to a Word table
; *****************************************************************************

Local $asArray[2][2] = [[$EQAddress,$Rivona],["",""]]
Local $oRange = _Word_DocRangeSet($oDoc, -2)
_Word_DocTableWrite($oRange, $asArray, 0)
If @error Then Exit MsgBox(0,"","Error creating the table." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
;~ MsgBox(0, "", "Table successfully added to the end of the document.")

Address.txt

Rivona.txt

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