S
slaprade
I am writing a .NET addin with VB2005 for Office 2007 using VSTO2005SE
I am attempting to select a part of a document (SENTENCE, PARAGRAPH, WORD
whatever) using word.selection which indicated that I needed to implement
selection so I created a class SelectionIMP with Implements
Word.Selection.
That created a large quantity of properties but I get the following two
messages
Error 40 Class 'SelectionImp' must implement 'Property Style() As Object'
for interface 'Microsoft.Office.Interop.Word.Selection'. Implementing
property must have matching 'ReadOnly' or 'WriteOnly' specifiers.
Error 41 'Style' cannot implement 'Style' because there is no matching
property on interface 'Microsoft.Office.Interop.Word.Selection'.
Which is kind of strange since hitting return on the Implements statement
created all the properties I could ever use including
Public Property Style() As Object Implements
Microsoft.Office.Interop.Word.Selection.Style
Get
End Get
Set(ByVal value As Object)
End Set
End Property
which I trimmed down to Get and End Get and added the ReadOnly
qualification. But to no avail
Do I have to use all of this to make a selection in a document from .NET
Stements like
'Dim selection1 As Word.Selection
'Dim returnValue As Word.Paragraphs
'returnValue = selection1.Paragraphs
just produce errors at run time
OIbviously, I don't know how to make a selection of something in a word
document from .NET so can someone give me a hint?
I am attempting to select a part of a document (SENTENCE, PARAGRAPH, WORD
whatever) using word.selection which indicated that I needed to implement
selection so I created a class SelectionIMP with Implements
Word.Selection.
That created a large quantity of properties but I get the following two
messages
Error 40 Class 'SelectionImp' must implement 'Property Style() As Object'
for interface 'Microsoft.Office.Interop.Word.Selection'. Implementing
property must have matching 'ReadOnly' or 'WriteOnly' specifiers.
Error 41 'Style' cannot implement 'Style' because there is no matching
property on interface 'Microsoft.Office.Interop.Word.Selection'.
Which is kind of strange since hitting return on the Implements statement
created all the properties I could ever use including
Public Property Style() As Object Implements
Microsoft.Office.Interop.Word.Selection.Style
Get
End Get
Set(ByVal value As Object)
End Set
End Property
which I trimmed down to Get and End Get and added the ReadOnly
qualification. But to no avail
Do I have to use all of this to make a selection in a document from .NET
Stements like
'Dim selection1 As Word.Selection
'Dim returnValue As Word.Paragraphs
'returnValue = selection1.Paragraphs
just produce errors at run time
OIbviously, I don't know how to make a selection of something in a word
document from .NET so can someone give me a hint?