How to check the Style property in managed code

D

Dougbert

In managed code, I'm trying to check the Style property of a Range object.
I'm having a problem because this appears to return a System.__ComObject
that .my code doesn't know what to do with.

How can I determine the Style of a Range in managed code? Thanks,

-Doug
 
G

Greg Maxey

I may be showing my ignorance here as I have no idea what "managed" code is.
In VBA, you and return the style of a range with:

Sub Scratchmacro()
Dim oRng As Word.Range
Set oRng = Selection.Range
MsgBox oRng.Style
End Sub
 
S

Stephen D. Oliver

you probably need to cast the returned object to an object of type Style.
 
Top