Rodger Posted January 7, 2015 Posted January 7, 2015 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
water Posted January 7, 2015 Posted January 7, 2015 Sure. Pass the object of the table to the function. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Rodger Posted January 7, 2015 Author Posted January 7, 2015 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.
water Posted January 7, 2015 Posted January 7, 2015 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: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Rodger Posted January 8, 2015 Author Posted January 8, 2015 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)
water Posted January 8, 2015 Posted January 8, 2015 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now