Hi =?Utf-8?B?RGF2aWQ=?=,
> I'm using Interop.Word in order to retrieve all paragraph styles of a word
> document. However, once I use the code such as:
[quoted text clipped - 10 lines]
> I think it's about managed code and unmanaged code conflict, but I've no
> idea how to fix it. Does anyone know how to fix it?
The compiler is doing a pretty good job of telling you what you need - I've
encountered worse :-)
Word.Style style = document.Paragraphs[i].get_Style();
MessageBox.Show(style.NameLocal);
The reason is a bit technical, but in "plain English": C# requires on strong
typing, unlike the way Word VBA is designed to work. The "interpreter" (PIA)
"translates" some of the VBA things into structures C# can work with. In this
case, a method pair - get_Style and set_Style - are substituted for the
.Style property.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
David - 31 Jul 2006 08:46 GMT
Thanks Cindy
> Hi =?Utf-8?B?RGF2aWQ=?=,
>
[quoted text clipped - 32 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)