PIA Problem

  • Thread starter Venketash \(Pat\) Ramadass
  • Start date
V

Venketash \(Pat\) Ramadass

Hi there,

I am using the Office 2003 PIA's as found at...
http://www.microsoft.com/downloads/...3a-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
 
V

Venketash \(Pat\) Ramadass

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top