How to persist add-in variables in Word documents?

A

Alex

Hello,

I am writing a Word add-in in C#.

Can anyone tell me what is the best way of persisting the add-in internal variables in a Word document?
I'd like to write them when the document is closed and read them when it is re-opened.

Thanks in advance,
Alex.
 
E

Eugene E. Starostin

Hello Alex,

You can use CustomDocumentProperties.

--
Regards from Belarus
Eugene Starostin
---
ADX Team
www.add-in-express.com - A new visual RAD tool for
developing COM add-ins, Smart Tags and RTD Servers

Hello,

I am writing a Word add-in in C#.

Can anyone tell me what is the best way of persisting the add-in internal
variables in a Word document?
I'd like to write them when the document is closed and read them when it is
re-opened.

Thanks in advance,
Alex.
 
C

Cindy M -WordMVP-

Hi Alex,
Can anyone tell me what is the best way of persisting the add-in internal variables in a Word document?
I'd like to write them when the document is closed and read them when it is re-opened.
My preference to a custom document property would be a document Variable (look
it up in the object model help, it's NOT the same variables you're used to
working with in a programming language). The advantages of a document Variable
vs. a property

- not visible to the user, only through automation of the object model
- can contain more characters (a doc prop is limited to either 128 or 256,
I can't remember which)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :)
 

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