PDA

View Full Version : Solved: Word 2007: Comboboxes and Bookmarks



cetest
06-19-2008, 07:37 AM
I use bookmarks and
includetext statements to load content from external files.

{includetext "{REF BKMRK}.docx" \* MERGEFORMAT}

Now i want to replace the bookmark by a dropdown or combobox
so as to reduce the number of typo's and choices impended by a text bookmark. I do not need a form.

Problem:

The standard combobox, such as used for "word 2007 forms" cannot be linked to the bookmark. Inserting and fill-in is all you can do.
The older activeX versions in the same menu do not seem to work
correctly in word2007, though i can open their VBA properties
and doubleclick opens a VBA programming window. I suppose that successfully using them requires just a bit too much knowledge of VBA for Word. I do can program standard VB6.
I do like and need the label-value combinations as used
in the forms standard combobox, as the selections needed contain
characters that wont' lead to a valid filename (such as :)
I found a way to link a combobox value to a bookmark:

activedocument.bookmark(name).range.text = value

Anyone can help me to take the last steps ??

Pls do not consider solutions for word 2003. 2003 and 2007 are essentially different (in my view), unless you ARE sure that they are compatible.

I am trying in a standard test.docm document. Not sure if that matters.

Gert

cetest
06-19-2008, 11:38 PM
I solved the solution, using a slightly modified
solution from another thread in this forum

[ link removed: new poster]


example2.zip contains just what i was looking for, with the only drawback
that the userform does pop-up at start, and cannot be changed after
loading. (though i suppose i could run the whole from a button again, that is for later investiogation)

I had to abandon the pre-cooked 2007 combobox from MSword,
and just use the older combobox concepts.