Show/hide dropdown boxes

V

Vinnie

Hello all,

I have created a word document that has several dropdown boxes in it (who
are filled from an sql database).

1) i would like that when a user wants to print the document, that those
dropdownboxes are not printed

2) i would like to create a toolbar with a button to show/hide the
dropdownboxes

Could anyone put me into the right direction.

Thanks already,
Vincent
 
D

Doug Robbins - Word MVP

I would suggest that you should be using a UserForm, rather than inserting
the dropdown boxes into the document.

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

and the following pages of fellow MVP Greg Maxey's website :

http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm

--
Hope this helps

Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to avail yourself of my
services on a paid, professional basis.
 
V

Vinnie

Hello Doug,

Thanks already for your reply.

Do you mean that the manipulations i would like to do are not possible outside
a userform ?

Greetings,
V.
 
D

Doug Robbins - Word MVP

What manipulations? What is the purpose of the dropdowns? If they were
FormField dropdowns as used in a document that is protected for filling in
forms, they do not appear as dropdowns when the document is printed, just
the item selected in the dropdown will appear.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
V

Vinnie

Hello Doug,

Let me rephrase my question a bit clearer :)

The dropdownboxes are not meant to be on a form, they are there to let the
user select predefined text that is stored on a sql database.

when the user selects an item in a dropdownbox, it is automatically filled
in (also by script of course) in a bookmark under the dropdown.

Now what i would like is to be able to hide the dropdowns:
- when the document is printed (or make sure that they do not appear on the
printout).

Is this possible (with having to create a form)?

Thanks,
 
D

Doug Robbins - Word MVP

I would do it with a userform.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
V

Vinnie

So no possible way to hide dropdowns, in the document and without userform,
when the document is printed ?

:( this would mean i have to redo my document (and since i'm a bit of a
newbee ...)

but thanks anyway for the answer.
 
D

Doug Robbins - Word MVP

You could select the combobox and assign a bookmark cmbbox to it and then
use the following code

ActiveDocument.Bookmarks("cmbbox").Range.Font.Hidden = True
Options.PrintHiddenText = False


--
Hope this helps

Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to avail yourself of my
services on a paid, professional basis.
 
V

Vinnie

Just one last question.
How do I "assign" a bookmark to a combobox ?

Thanks in advance.
 
V

Vinnie

ok, this is what i tried already.
i insert a combobox, i seldect it and then i insert a bookmark.

As far as i can see, the combobox is IN the bookmarkt.

I have then created 2 buttons:
1) show bookmarkt
2) hide bookmark
for test i put a msgbox with the buttons, so i can see that they are called.

Both buttons work and i have put the code to hide the bookmark :
ActiveDocument.Bookmarks("cmbbox").Range.Font.Hidden = True
Options.PrintHiddenText = False

I have also checked the print options before printing and the checkbox with
hidden text is unchecked.
But in the printpreview the checkbox is still visible.

Is this normal?

Greetings,
 
D

Doug Robbins - Word MVP

Select it and then create a bookmark in the usual way.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
D

Doug Robbins - Word MVP

If thought we were talking about a combobox. Where did the checkbox come
into it?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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