Question changing table cell alignment using vb.net

Please provide a FULL and CLEAR explanation of the problem and also post your questions in the most appropriate forum. This is clearly not a question about the VS IDE so it should not be posted in a forum dedicated to that. What table are you talking about? Do you mean an HTML table? If so then you should have posted in a forum about HTML/ASP.NET? Please provide ALL the relevant information and we will move this thread to an appropriate forum.
 
Please provide a FULL and CLEAR explanation of the problem and also post your questions in the most appropriate forum. This is clearly not a question about the VS IDE so it should not be posted in a forum dedicated to that. What table are you talking about? Do you mean an HTML table? If so then you should have posted in a forum about HTML/ASP.NET? Please provide ALL the relevant information and we will move this thread to an appropriate forum.

Oki thanks. It is A Microsoft word document table.
 
I never would have guessed that, so that's a demonstration of why it's important to provide all the relevant details. Unfortunately, we don't have a forum dedicated to VSTO, so I've moved this thread to VB.NET General. I have no particular expertise in Office development but a quick search led me here, so maybe that's somewhere for you to start.
 
I converted the code for you:
Get text in a Word table to vertical align:
Imports Microsoft.Office.Interop.Word

Module Program
    Sub Main(args As String())
        Dim document As New DocumentClass()
        Dim defaultTableBehavior As Object = Nothing
        Dim autoFitBehavior As Object = Nothing
        Dim tbl As Table = document.Content.Tables.Add(document.Content, 2, 2, defaultTableBehavior, autoFitBehavior)
        tbl.Rows(2).Cells(2).Range.InsertAfter("This is a test.")
        tbl.Rows(2).Cells(2).Range.ParagraphFormat.SpaceAfter = 0F
        tbl.Rows(2).Cells.Height = 50F
        tbl.Range.Rows(2).Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalBottom
    End Sub
End Module

SEE AlSO:
tbl.Range.ParagraphFormat.SpaceAfter = 1 'change the 1 to how much space you want extra in your cell
 
Back
Top