If you’ve got a small table, you can select the “Around” option to have your document’s main body of text wrap around the table so that you’re not left with a lot of white space on the page. There’s also one more setting you should be aware of here: text wrapping.
Here, we’re indenting our table a full inch from the left margin. If you’re aligning your table to the left side of the page, you can also adjust the space of the indent from the left margin using the “Indent From Left” box to the right. It gives you a little more control than just dragging the handle the way we showed you before. While you’re here, note that you can also fine-tune the width of your table by selecting the “Preferred Width” option and then specifying exactly how wide it should be. WT1.Cell(i + 2, 2).Range.Text = "a" 'DGV1.Rows(i).Cells(2).In the Table Properties window that opens, you can choose left, center, or right alignment by clicking those options in the “Alignment” section. Thanks for helping make community forums a great place. We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Set WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5) Set WD = WA.Documents.Open(model_address, ReadOnly:=True) 'model_address = Application.StartupPath & "\GTMS_MDL.docx"
Here is the test code in VBA for your reference: Sub test() I would suggest that you test the code using a new document to see whether the issue is realtive to the specific document. What effect did you want to achieve? Based on the code samlpe you were setting the verical alignment to bottom however the description are center. Both center and bottom for the vertical alignment works well for me. The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine> “.Cells.VerticalAlignment = ” seems >The problem is that the instruction “.Rows.Height = 8” and “.Cells.VerticalAlignment = ” seems WT1.Cell(lin_wt1 + 2, 1).Range.Text = "TOTAL GERAL"
Rows(1).Shading.BackgroundPatternColor = WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5) WD = WA.Documents.Open(model_address, :=True) Pic_address = Application.StartupPath & "\PIC\TABELA01.png" Model_address = Application.StartupPath & "\GTMS_MDL.docx"
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Clickĭim model_address, mes_extenso, texto, texto_ref, pic_address As String The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine. Not work, besides, when I try to adjust the rows height and vertical alignment by myself, after routine generates the table of course, Word don´t allow me to do these adjustment by hand. The problem is that the instruction “.Rows.Height = 8” and “.Cells.VerticalAlignment = ” seems Can somebody clear my mind? I did the code below, and this generates a beautiful and clean table on word 2010.