I am trying to add 2 tables into my code for an automate email. However, the result comes out as a table in a table with no borders. I am unable to get them separated with borders.
The following is my result and syntax :
Code:
myitem.Display
Set ins = oOutlook.ActiveInspector
Set document = ins.WordEditor
Set Word = document.Application
Set selection = Word.selection
selection.TypeText Text:="Dear Requester,"
selection.TypeParagraph
selection.TypeParagraph
With selection
.Font.Bold = True
End With
selection.TypeText Text:="Please confirm that quotation of chosen vendor is suitable before proceeding with PR creation."
selection.TypeParagraph
selection.TypeParagraph
'add table here
Set objTable = selection.Tables.Add(Range:=selection.Range, NumRows:=3, NumColumns:=2)
objTable.Borders.OutsideLineStyle = wdLineStyleSingle
objTable.Borders.OutsideLineWidth = wdLineWidth150pt
objTable.Borders.OutsideColor = wdColorBlack
objTable.Cell(1, 1).Range.Text = "Initial quote :"
objTable.Cell(1, 2).Range.Text = " "
objTable.Cell(2, 1).Range.Text = "Discount rate :"
objTable.Cell(2, 2).Range.Text = ""
objTable.Cell(3, 1).Range.Text = "Final quote :"
objTable.Cell(2, 2).Range.Text = ""
selection.TypeParagraph
selection.TypeParagraph
Set objTable2 = selection.Tables.Add(Range:=selection.Range, NumRows:=2, NumColumns:=2)
objTable2.Borders.OutsideLineStyle = wdLineStyleSingle
objTable2.Borders.OutsideLineWidth = wdLineWidth150pt
objTable2.Borders.OutsideColor = wdColorBlack
objTable2.Cell(1, 1).Range.Text = "Last spend on year 2020 :"
objTable2.Cell(1, 2).Range.Text = " "
objTable2.Cell(2, 1).Range.Text = "Incremental increase percentage :"
objTable2.Cell(2, 2).Range.Text = ""
The result that I want is: