Hi Lme,
I am new to programming with Word, however, familiar with Access. I've
programmed a document with a Combobox and a label (that changes depending on
selection of the Combobox). When I save the document (under a new name) and
open it, the default selection appears in the Combobox. I would like the
document to save the changes.
This is tricky, because the changes have to be made to the controls'
PROPERTIES, in the Design mode. What you assign them to do in the document, at
run time, won't affect the properties behind the scenes, in the code layer
unless you're working with the "guts" behind the scenes.
Go the the msdn site at microsoft.com and search for an article by me about
using ActiveX controls in Word documents. Consider the code examples and the
discussion about whether to use OleFormat.Object to address them, or
ThisDocument.ControlName. From what I see on my computer, the former writes to
the controls' properties, while the latter is just the "display interface".
Note, however, that there is no way to save combobox lists or selections in a
Word document. Combo- and listboxes have to be filled at run-time (just as in
userforms). The user selection would have to be saved in the document, read by
your macro, and restored to the combobox. You could use a custom document
property or a document variable for this.
Please note that this question would have better been posted in one of the
word.vba newsgroups; this newsgroup is for end-users, so you're less likely to
get a quick and knowledgeable response.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail