VbSciprt - The total table to be right aligned in the Signature RRS feed

  • Question

  • hi,

    I need to create a Signature in outlook. 

    where i need to post the picture in a table which need to be right aligned..the total table to be right aligned..i searched a lot but got the alignment for the cell contents but not the table. I would like to create a Table in word with contents to be right aligned.

    Below is my code please kindly help me out to fix it.

    Const END_OF_STORY = 6

    wdAlignParagraphCenter = 2

    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    Set objDoc = objWord.Documents.Add()

    Set objSelection = objWord.Selection
    objSelection.Paragraphs.Alignment = wdAlignParagraphCenter
    objSelection.typeText "Naveen"
    objSelection.Paragraphs.Alignment = wdAlignParagraphCenter
    objSelection.ParagraphFormat.Alignment = 2
    Set objRange = objSelection.Range
    objDoc.Tables.Add objRange, 1,1
    Set objTable = objDoc.Tables(1)
    objSelection.Font.Bold = True

    objTable.Cell(1, 1).Range.Text = "This is Cell 1"
    'objTable.Range.Paragraphs.Alignment = 2
    objtable.Range.ParagraphFormat.Alignment = 2

    objSelection.EndKey END_OF_STORY

    thanks in advance


    Saturday, March 26, 2016 7:13 AM

All replies