Dropdown selection displays a shape with text.

B

boredofcities

Hi,

I'm in the process of creating an automated document to save our company
time. I have a dropdown form field that has 5 cases. Case 1 ' ', Case 2 'A',
Case 3 'B' Case 4 'C' and Case 5 'D'.

Depending on the selection that is made, I would like a shape to be created
with the corresponding letter, A, B, C, or D and the shape to be filled with
a certain colour (RGB scale).

I don't know if this is asking a bit much from Word, or whether something
this complicated can be achieved, but the shape is quite small H 0.8cm by W
1.4cm.

I'm using Word 2007, and the document is protected for filling forms.

Help would be greatly appreciated.

Thanks

Matt.
 
D

Doug Robbins - Word MVP

I think that you might have to create each of your colored shapes containing
a letter as a .jpg image and then use code to insert the appropriate image
based on the selection made.

--
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
 
B

boredofcities

Thanks for your response Doug. Its a good idea to do that but I perhaps
should of mentioned that the document I'm creating will be sent out usual by
email to our staff, so it would require sending out the .jpg images as well.
Is there a way that, that can be incorporated into a VBA?

Sorry, but I'm a complete novice and trying to learn as I go along.
 
D

Doug Robbins - Word MVP

You could create autotext entries for each of the images in the template
that contains your form and have a single cell borderless table (assumed to
be the first table in the document) where you want the image to be displayed
and then run the following macro on exit from the dropdown formfield

Dim strLetter as String
With ActiveDocument
strLetter = .FormFields("DropDown1").Result
If strLetter <> " " Then
.Unprotect
.Tables(1).Cell(1, 1).Range.Select
With Selection
.TypeText strLetter
.Range.InsertAutoText
End With
.Protect wdAllowOnlyFormFields, NoReset
End If
End With


--
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
 
B

boredofcities

Hi Doug,

The idea of creating the autotext entries was a brilliant idea and the macro
works like a treat. My problem is now exporting the autotext entries to the
30 odd users that will need have access to it. I understand that I can save
the normal.dot as a new template and send it to every computer, but I was
hoping to try and avoid this.

Is there another way of having the autotext entries available to all the
users?

Thanks Doug, you been a great help.
 
D

Doug Robbins - Word MVP

The form itself should be saved as a template with the autotext entries
saved in that template. Then the template containing the form should be
sent to the users, who would then use File>New and select that template when
they need to fill out a form.

See the article "Using AutoText†at:

http://www.word.mvps.org/FAQs/Customization/AutoText.htm

and

See the article "Distributing macros to other users†at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
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
 
B

boredofcities

That's solved it. Seemed like I had tried everything.

Thanks for everything Doug,

Matt.
 

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