Group:  General ยป microsoft.public.office.xml
Thread: Manimulate open/active document in word

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Manimulate open/active document in word
Matthias Langbein <langbein[ at ]t-online.de> 01.11.2005 00:14:22
Hi all,
i want to insert a special "word fields" in a document which is
currently loaded in word 2003 via .NET (C#).

As far as i know a field is devided into a field instruction and field
definition. I'm not quite sure which one is which, but one stores some
information, a formula for example (I think this is the instruction),
and the other one stores what is displayed in the word document (I
think this is the definition).

I want that the instruction stores some information and the
definition stores a image which is displayed in word.

The corresponding XML-Code looks like this:

<w:r><w:fldChar w:fldCharType="begin"/></w:r>
<w:r><w:instrText>MyText</w:instrText></w:r>
<w:r><w:fldChar w:fldCharType="separate"/></w:r>
<w:r><w:t> {picture} </w:t></w:r>
<w:r><w:fldChar w:fldCharType="end"/></w:r>

I managed to handle this by hand by inserting a field/formula with the
Value "MyText" which results in an error message displayed in the
document, setting the cursor in between the error message, insert the
picture and delete alle the letters of the error message before and
after the picture.

But this is definitely not a good way for automation, so I wondered
weather the insertion of the XML-code, as I know exactly what to
insert, is possible via .NET and if so, how to do this. Or is it
possible to navigate through the XML-Nodes of a document which is
currently loaded into word and insert XML-Tags there?

THX for any tips... Langi

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net