Form with button "imitating" arrow up/down

  • Thread starter Thread starter Andreas
  • Start date Start date
A

Andreas

Hi,

I would like to imitate the keyboard-keys arrow up and arrow down
within a userform.

Aim: in the email list is one email marked by a mouse click. This mark
should be moved upwards or downwards depending on a button used in the
form.

At the moment it is realiced by "knowing" the entryid of the marked
email, counting the emails starting at the youngest en ending at the
marked one, using this number by adding 1 oder subtrahating 1 and then
searching the next or previous email. When the marked email is the
150th, it takes a little long... ;-)

I guess, there might be a possibility using
activeexplorer.selection(1) or the like?

How can I solve the problem in a simple way???
Thanx anyway!!!

Andreas
 
What version of Outlook? Please supply relevant information.

Your method has a lot of pitfalls. Depending on the sort order and filter on
the current view as well as any groupings, your algorithm might fail to work
correctly. The items you get back from the Items collection may or may not
match what you see depending on those factors.

Probably about the best way, and it's a total hack that I find really ugly,
would be to use SendKeys and pass along the up or down arrow keys.
 
Hello Ken,

Probably about the best way, and it's a total hack that I find really ugly,
would be to use SendKeys and pass along the up or down arrow keys.

It might in fact be a ugly hack but works fine for me!!! Thank you
very much!!!!

Andreas
 
Back
Top