Joined: 05 May 2009
|Posted: Tue May 05, 2009 5:54 am Post subject: Replacing a field in the header or footer in a document
I'm using OO 3.0 on Vista and have to open a MS Word document via C# (see below).
object usm = Activator.CreateInstance(Type.GetTypeFromProgID("com.sun.star.ServiceManager"));
object desk = Invoke(usm, "createInstance", "com.sun.star.frame.Desktop");
object writeDoc = Invoke(desk, "loadComponentFromURL", PathConverter(@"D:\Projekte\OpenOfficeTest\b030101.doc"), "_blank", 0, new object);
So far, the document is open and well shown, the document contains a header and a footer with fields defined in MS Word. My question is how to replace the fields with informations generated during runtime in the header or footer programmaticly?
Thank you in advance for your time!