我创建了一个表。该表从文档的第一行开始。我的问题是我不能在表格上方插入一行。每次我尝试添加段落时,段落都会插入到最后一个表格之后。有没有办法在第一个表上方插入 lin ?
为了说明我的问题:
到目前为止我的代码:
Dim oApp As Word.Application
Dim oDoc As Word.Document
oApp = CType(CreateObject("Word.Application"), Word.Application)
oDoc = oApp.Documents.Add()
Dim rng As Word.Range = oDoc.Range(0, 0)
rng.Font.Name = "Verdana"
rng.Font.Size = 16
Dim para As Word.Paragraph = oDoc.Paragraphs.Add()
para.Range.Text = "Factsheet"
Dim tlb6 As Word.Table = oDoc.Tables.Add(Range:=rng, NumRows:=1, NumColumns:=4)
Dim CurrentDateTime As Date = Date.Now
Dim CurrentDate As Date = New Date(CurrentDateTime.Year, CurrentDateTime.Month, CurrentDateTime.Day)
tlb6.Cell(1, 1).Range.Text = "Date"
tlb6.Cell(1, 1).Shading.BackgroundPatternColor = Word.WdColor.wdColorGray20
tlb6.Cell(1, 1).Borders.OutsideLineStyle = 1
tlb6.Cell(1, 2).Range.Text = CurrentDate
tlb6.Cell(1, 2).Borders.OutsideLineStyle = 1
tlb6.Cell(1, 3).Range.Text = "Issued by"
tlb6.Cell(1, 3).Shading.BackgroundPatternColor = Word.WdColor.wdColorGray20
tlb6.Cell(1, 3).Borders.OutsideLineStyle = 1
tlb6.Cell(1, 4).Range.Text = ""
tlb6.Cell(1, 4).Borders.OutsideLineStyle = 1