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
Greg Maxey - 11 Sep 2007 01:46 GMT
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

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> 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
[quoted text clipped - 3 lines]
>
> -Doug
Stephen D. Oliver - 11 Oct 2007 07:15 GMT
you probably need to cast the returned object to an object of type Style.
> 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
[quoted text clipped - 3 lines]
>
> -Doug