VBA Code to Open or Expand a Drop Down List

RaudelJr
2StarLounger
Posts: 136
Joined: 17 Apr 2017, 19:16

VBA Code to Open or Expand a Drop Down List

Post by RaudelJr »

Hi,

Is there a way to VBA Code to Open or Expand a Drop Down List in Word?

I've been using the following code:

Code: Select all

Sub AutoDropDown()
  SendKeys "%{down}"
End Sub
But I've been reading that SendKeys is discouraged and only as a last resort.
Any other way to achieve the same?

Thank you for your help in advance.

Raudel


EDIT > Attached an image of what I need.

It's a Legacy Dropdown Form Field.
during the form field, the dropdown will be accessed by tab'ing into it or clicking.
the Macro is inserted into the "Run Macro on Entry" field.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA Code to Open or Expand a Drop Down List

Post by HansV »

I don't think there is another way, and in this situation, SendKeys should work as intended.
Best wishes,
Hans

RaudelJr
2StarLounger
Posts: 136
Joined: 17 Apr 2017, 19:16

Re: VBA Code to Open or Expand a Drop Down List

Post by RaudelJr »

HansV wrote:I don't think there is another way, and in this situation, SendKeys should work as intended.
Thank you HansV :evilgrin: