Re: PIA Problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Should I be able to do something like...

foreach(Paragraph paragraph in document.Paragraphs)

{

Type type = paragraph.Range.GetType();

MethodInfo mi = type.GetMethod("get_Style");

if(mi != null)

{

object value = mi.Invoke(paragraph, null);

Style style = (Style)value;

MessageBox.Show(style.NameLocal);

}

}

Thanks.

-Pat

"Venketash (Pat) Ramadass" <pat.ramadass@xxxxxxxxxxxxxx> wrote in message
news:uZIR3%23MHGHA.3056@xxxxxxxxxxxxxxxxxxxxxxx
> Hi there,
>
> I am using the Office 2003 PIA's as found at...
> http://www.microsoft.com/downloads/details.aspx?FamilyID=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&DisplayLang=en
>
> I am trying to iterate through all the paragraphs of a document and get
> the respective styles and for specific style names extract the text of the
> paragraph using c#.
>
> The "Using Accessor methods in Word" at...
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/OffCSharp.asp
> ...seems to be what I want. But I cannot for the life of me find get_Style
> or set_Style on my Range object as in that example. Even tried reflection
> to no avail. Am I using the wrong PIA? Am I calling it incorrectly?
>
> Any help would be appreciated as I am rather confused.
>
> Kind regards,
>
> -Venketash (Pat) Ramadass
>


.



Relevant Pages

  • Re: TAN/ What we are
    ... However, I salute your efforts, clearly seen, before you give up!! ... the matter expressed in paragraph one, with the rest of the e-mail ... It's like chat, but then, if you're going to chat, why not actually do that?!! ... I'm not calling anyone names. ...
    (rec.arts.tv.soaps.cbs)
  • Re: Font-family
    ... Luigi Donatello Asero wrote: ... distinguish the s by calling them by different names on the one ... hand, but, on the other hand, display them as if all of them were the ... They do not say *that* every paragraph should have a ...
    (alt.html)
  • Re: How do I get this to stop? Any help appreciated
    ... All name calling aside, can you explain this paragraph to me, I don't ... know anything about bios code but I find this interesting. ... CIDR is "Customer Identification Record" ...
    (misc.consumers)
  • Re: How do I get this to stop? Any help appreciated
    ... All name calling aside, can you explain this paragraph to me, I don't ... know anything about bios code but I find this interesting. ... Totally meaningless ...
    (misc.consumers)