polps Posted May 9, 2019 Share Posted May 9, 2019 (edited) Hi all, I need a little help regarding a Word issue. I'm automating (whit success) a word document starting from a text file. I'm able to create a new document, write text, add tables, using both Word UDF and Word objects. I'm creating a new table $oTable = $oDoc.Tables.Add($oEndDocRange, 2, 4) $oTable.Columns(1).Width = 60 $oTable.Columns(2).Width = 420 With $oTable.Borders .InsideLineStyle = 1 ;wdLineStyleSingle .OutsideLineStyle = 1 ;wdLineStyleDouble EndWith $Row = 1 $Col = 2 $oCellRange = $oTable.Cell($Row,$Col).Range $oCellRange.Text = "Espressione" $oCellRange.Font.Bold = True $oCellRange.Shading.BackgroundPatternColor = -603917569 Now I want to resize the width of a SINGLE CELL (not the entire column) I registered a VBA marcro and this is the code Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=50, RulerStyle:=wdAdjustFirstColumn Can help me to translate this VBA in AutoIT? Or, there is more correct way to resize a cell? Thanks a lot! Edited May 10, 2019 by polps Link to comment Share on other sites More sharing options...
jdelaney Posted May 9, 2019 Share Posted May 9, 2019 Cell object. Google your problem in vbs and it's easy to convert to autoit. https://docs.microsoft.com/en-us/office/vba/api/word.table.cell IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
polps Posted May 9, 2019 Author Share Posted May 9, 2019 Hi jdelaney and thanks for the quick replay. I solved $oTable.Cell($row, $col).Width = 200 Thanks a lot Nas 1 Link to comment Share on other sites More sharing options...
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