View Single Post
 
Old 08-04-2019, 06:57 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

How about:

Code:
Private Sub InsertingBlankLine()
Dim oWord As Object
Dim oDoc As Object
Dim oCell As Object
  On Error Resume Next
  Set oWord = GetObject(, "Word.Application")
  If Err Then
    Set oWord = CreateObject("Word.Application")
  End If
  On Error GoTo 0
  Set oDoc = oWord.Documents.Add
  oWord.Visible = True
  With oDoc
    .Content = "kdhfdskfhd fkdshfdkfhdskfhdsfd fdshgfdjdsjfg" & vbCr & vbCr & "Paragraph / Line after table"
    .Tables.Add .Paragraphs(2).Range, 8, 5
    With .Tables(1)
      .Borders.Enable = True
      Set oCell = .Cell(1, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 1"
      oCell.Bold = True
      Set oCell = .Cell(2, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 2"
      Set oCell = .Cell(3, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 3"
      Set oCell = .Cell(4, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 4"
      Set oCell = .Cell(5, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 5"
      Set oCell = .Cell(6, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 6"
      Set oCell = .Cell(7, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 7"
      Set oCell = .Cell(8, 1).Range
      oCell.End = oCell.End - 1
      oCell.Text = "row 8"
      .Range.Font.Name = "Tahoma"
      .Range.Font.Size = 15
    End With
  End With
  Set oWord = Nothing
  Set oDoc = Nothing
  Set oCell = Nothing
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote