J
Johnny E. Jensen
Hello NG
I am creating templates from VB.NET besause with VB i have the abillity to
use late binding and therefore don't have to code to a specific version of
Word. (as long i don't use specific version 2007 commands to a version 2003
Word I know that)
When i use spec relation to Word 2007 - setting the reference to Microsoft
Word 12.0 object the following works fine.
Dim objTable As WD.Table
Dim objBorder As WD.Border
Dim objRange As WD.Range
objRange = objDoc.Range(Start:=0, End:=0)
objTable = objDoc.Tables.Add(Range:=objRange, NumRows:=3,
NumColumns:=20)
With objDoc.Bookmarks
.Add(Name:="WinnerCRM_OfferTable", Range:=objTable.Cell(1,
1).Range)
.Add(Name:="WinnerCRM_OfferLines", Range:=objTable.Cell(2,
1).Range)
End With
But when i remove the reference to Microsoft Word 12.0 object the following
(Changed code) don't work.
Dim objTable As Object
Dim objBorder As Object
Dim objRange As Object
objRange = objDoc.Range(Start:=0, End:=0)
objTable = objDoc.Tables.Add(Range:=objRange, NumRows:=3,
NumColumns:=20)
With objDoc.Bookmarks
.Add(Name:="WinnerCRM_OfferTable", Range:=objTable.Cell(1,
1).Range) <----- ERROR HERE
.Add(Name:="WinnerCRM_OfferLines", Range:=objTable.Cell(2,
1).Range)
End With
The error recieved is - The type is not a referenced by type????
Can anyone give me a hand here??
Kind regards
Johnny Jensen
I am creating templates from VB.NET besause with VB i have the abillity to
use late binding and therefore don't have to code to a specific version of
Word. (as long i don't use specific version 2007 commands to a version 2003
Word I know that)
When i use spec relation to Word 2007 - setting the reference to Microsoft
Word 12.0 object the following works fine.
Dim objTable As WD.Table
Dim objBorder As WD.Border
Dim objRange As WD.Range
objRange = objDoc.Range(Start:=0, End:=0)
objTable = objDoc.Tables.Add(Range:=objRange, NumRows:=3,
NumColumns:=20)
With objDoc.Bookmarks
.Add(Name:="WinnerCRM_OfferTable", Range:=objTable.Cell(1,
1).Range)
.Add(Name:="WinnerCRM_OfferLines", Range:=objTable.Cell(2,
1).Range)
End With
But when i remove the reference to Microsoft Word 12.0 object the following
(Changed code) don't work.
Dim objTable As Object
Dim objBorder As Object
Dim objRange As Object
objRange = objDoc.Range(Start:=0, End:=0)
objTable = objDoc.Tables.Add(Range:=objRange, NumRows:=3,
NumColumns:=20)
With objDoc.Bookmarks
.Add(Name:="WinnerCRM_OfferTable", Range:=objTable.Cell(1,
1).Range) <----- ERROR HERE
.Add(Name:="WinnerCRM_OfferLines", Range:=objTable.Cell(2,
1).Range)
End With
The error recieved is - The type is not a referenced by type????
Can anyone give me a hand here??
Kind regards
Johnny Jensen