E
Enrique Rojas
Hello All,
I have been trying to add a table at the end of a document with the
code below. I get Error 4608 Value out of Range. I think it has
something to do with my Set rngParagraphs line. If Anyone can help me
I would appreciate it.
Thanks
Public Sub InsertSignatureBlock(objw As Word.Application)
Dim myTable As Word.Table
Dim myRow As Word.Row
Dim myRange As Word.Range
Dim myCol As Word.Column
Dim rngParagraphs As Range
Set rngParagraphs =
objw.ActiveDocument.Range(objw.ActiveDocument.Content.End)
Set myTable = objw.ActiveDocument.Tables.Add(rngParagraphs, 6, 5)
myTable.Columns(1).Width = objw.InchesToPoints(0.5)
myTable.Columns(2).Width = objw.InchesToPoints(0.5)
myTable.Columns(3).Width = objw.InchesToPoints(0.5)
myTable.Columns(4).Width = objw.InchesToPoints(0.5)
myTable.Columns(5).Width = objw.InchesToPoints(0.5)
With myRow
.Cells(2).Range.InsertAfter ("2")
.Cells(3).Range.InsertAfter ("3")
.Cells(4).Range.InsertAfter ("4")
.Cells(5).Range.InsertAfter ("5")
End With
End Sub
I have been trying to add a table at the end of a document with the
code below. I get Error 4608 Value out of Range. I think it has
something to do with my Set rngParagraphs line. If Anyone can help me
I would appreciate it.
Thanks
Public Sub InsertSignatureBlock(objw As Word.Application)
Dim myTable As Word.Table
Dim myRow As Word.Row
Dim myRange As Word.Range
Dim myCol As Word.Column
Dim rngParagraphs As Range
Set rngParagraphs =
objw.ActiveDocument.Range(objw.ActiveDocument.Content.End)
Set myTable = objw.ActiveDocument.Tables.Add(rngParagraphs, 6, 5)
myTable.Columns(1).Width = objw.InchesToPoints(0.5)
myTable.Columns(2).Width = objw.InchesToPoints(0.5)
myTable.Columns(3).Width = objw.InchesToPoints(0.5)
myTable.Columns(4).Width = objw.InchesToPoints(0.5)
myTable.Columns(5).Width = objw.InchesToPoints(0.5)
With myRow
.Cells(2).Range.InsertAfter ("2")
.Cells(3).Range.InsertAfter ("3")
.Cells(4).Range.InsertAfter ("4")
.Cells(5).Range.InsertAfter ("5")
End With
End Sub