Jump to content

Recommended Posts

Posted

Hello,

Is there a way to read the tablecontent with "_Word_DocTableRead" when the table is in the header of the Word Document ?

Thanks,

Rodger

Posted

Sure. Pass the object of the table to the function.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

This is my code:

#include <Word.au3>
#include <Array.au3>

$oWord = _Word_Create()
$oDoc = _Word_DocOpen($oWord, "sjabloon.doc", Default, Default, True)
$oDoc.Sections(1).Headers(1).Range.Select()
$asResult = _Word_DocTableRead($oDoc.Tables(1),1)
_ArrayDisplay($asResult)
$oDoc.Activewindow.View.Type = 6

It doesn't work.

Posted

The UDF doesn't work with selections but with ranges. I have no access to Word right now but  it should look like:

$oTable = $oDoc.Sections(1).Headers(1).Tables.Item(1)
$asResult = _Word_DocTableRead($oDoc, $oTable)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Thanks for helping me in the right direction and I solved it:

$oTable = $oDoc.Sections(1).Headers(1).Range.Tables(1)
$asResult = _Word_DocTableRead($oDoc, $oTable, 1)
Posted

:)

My UDFs and Tutorials:

  Reveal hidden contents

 

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...