Drop Down Box

User avatar
Graeme
Cosmic Lounger
Posts: 1231
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Drop Down Box

Post by Graeme »

Hello

My Word document has a drop down box which includes 9 different choices.

There is an image associated with each choice. Would it be possible to display the image, on the page as a result of the choice made in the drop down?

Thanks

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/

User avatar
Charles Kenyon
5StarLounger
Posts: 620
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Drop Down Box

Post by Charles Kenyon »

Yes. I am assuming that the drop down is a Content Control.
See the links provided by macropod (Paul Edstein) in this thread.
https://www.msofficeforums.com/166772-post4.html
Rather than text, you would be inserting an image.
The images could be separate files using an IncludePicture or the equivalent command or could be stored in a template as AutoText entries.
Last edited by Charles Kenyon on 08 Aug 2023, 16:37, edited 1 time in total.

User avatar
Graeme
Cosmic Lounger
Posts: 1231
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Re: Drop Down Box

Post by Graeme »

Thanks for your response Charles.

I'll have another good read through your link after another coffee.

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/

User avatar
Graeme
Cosmic Lounger
Posts: 1231
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Re: Drop Down Box

Post by Graeme »

Charles Kenyon wrote:
08 Aug 2023, 01:53
Yes. I am assuming that the drop down is a Content Control.

Yes it is. The document is an astronomy Certificate of of achievement. There are 9 categories so there are 9 items to chose from in the Drop down. The selection just inserts the category name text at the location of the drop down chooser.

I would like the choice to place the text and also place a linked image. Just the image somewhere on the page or a watermark, I'm not fussed. I've searched but can't find anything that explains how to do this, is it possible?

Your links appear to be related to interdependent combo boxes. I had these in an Access database I compiled in a previous life but that's not what I'm after in this instance.

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/

snb
4StarLounger
Posts: 582
Joined: 14 Nov 2012, 16:06

Re: Drop Down Box

Post by snb »

You can use a combination of a ContentControl, an 'IF"- field, a 'DocVariable"-field and an "IncludePicture"-field
You do not have the required permissions to view the files attached to this post.

User avatar
Graeme
Cosmic Lounger
Posts: 1231
Joined: 11 Feb 2010, 12:23
Location: Medway, Kent, UK

Re: Drop Down Box

Post by Graeme »

Perfect!

Thanks snb.

Regards

Graeme
_______________________________________

http://www.averywayobservatory.co.uk/

snb
4StarLounger
Posts: 582
Joined: 14 Nov 2012, 16:06

Re: Drop Down Box

Post by snb »

Simpler approach:

{ IF {Docvariable pict} ="" "" {Includepicture {Docvariable pict}}}

Code: Select all

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    ThisDocument.Variables("pict") = "G:\OF\" & ContentControl.Range & ".jpg"
    ThisDocument.Fields.Update
End Sub