6/30/2023 0 Comments Word table cell vertical alignment![]() If my understanding is correct, "tblnew" should already be referring to the "actidocument.tables(1)" so the code should be identicle, and the "with word" object should mean that the code is being executed in word as it would have been already, so im not sure where the issue lies. ![]() Running the following in the immediate window in word also works activedocument.Tables(1).Rows(1).Cells.VerticalAlignment = wdAlignVerticalCenter Rows(1).Cells.VerticalAlignment = wdAlignVerticalCenter This example creates a 3x3 table in a new document and assigns a sequential cell number to each cell in the table. A variable that represents a 'Cells' collection. ![]() However when I run the same code in MS word directly, it works without any issues.Ĭode in Excel (word object is created as a word object, and tblnew is set to be a newly created table, other format changes with the table in the format work i.e font size, cell size and contents) with word Returns or sets the vertical alignment of text in one or more cells of a table. ![]() I am trying to get the first two rows of each table made to vertically align in the center, and while it does not come up with an error, I don't see any change. I am currently creating a function in excel which will create a table in MS word and fill in with data from excel, I am trying to format the table and having some issues with alignment.
0 Comments
Leave a Reply. |