Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

How to check the Style property in managed code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dougbert - 10 Sep 2007 22:27 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.