A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Automate keystrokes w/ VBA?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 17th 06, 07:37 PM posted to microsoft.public.outlook.program_vba
Rich Roller
external usenet poster
 
Posts: 8
Default Automate keystrokes w/ VBA?

Goal: Allow user to jump to a certain screen/field in Outlook 2003 to
quickly tag a contact record. Essentially I want to automate the following
sequence of keystrokes:
-Contacts
-All Fields tab
-All Contact Fields
-User Field 4 & enter a value of "HH"

I had imagined I'd just go into Macro and say "start recording keystrokes"
but that doesn't seem to exist. Correct?

Then I thought I could write something in VBA but I'm a VBA novice and I
don't quite know how to do what I want. Does anyone know/have any code that
would do this?

And if it can be done w/ VBA, can I trigger it from a hotkey combination or
a custom toolbar button?

Or if there's another/better way (other than VBA) of accomplishing what I
want, I'm all ears.

Thanks in advance for an advice!

-Rich



Ads
  #2  
Old February 18th 06, 07:54 AM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default Automate keystrokes w/ VBA?

On Fri, 17 Feb 2006 13:37:43 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:

Goal: Allow user to jump to a certain screen/field in Outlook 2003 to
quickly tag a contact record. Essentially I want to automate the following
sequence of keystrokes:
-Contacts
-All Fields tab
-All Contact Fields
-User Field 4 & enter a value of "HH"

I had imagined I'd just go into Macro and say "start recording keystrokes"
but that doesn't seem to exist. Correct?


Correct.

Then I thought I could write something in VBA but I'm a VBA novice and I
don't quite know how to do what I want. Does anyone know/have any code that
would do this?


ActiveInspector.CurrentItem.User4 = "HH"

And if it can be done w/ VBA, can I trigger it from a hotkey combination or
a custom toolbar button?

[snip]

Custom Toolbar Button is trivial: (View/Toolbar/Customize...). To add a
keyboard shortcut, see http://support.microsoft.com/?kbid=252427.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #3  
Old February 18th 06, 01:45 PM posted to microsoft.public.outlook.program_vba
Rich Roller
external usenet poster
 
Posts: 8
Default Automate keystrokes w/ VBA?

AWESOME! Thank you Michael. I never thought it would be such a simple,
one-line procedure! -Rich

"Michael Bednarek" wrote in message
...
On Fri, 17 Feb 2006 13:37:43 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:

Goal: Allow user to jump to a certain screen/field in Outlook 2003 to
quickly tag a contact record. Essentially I want to automate the
following
sequence of keystrokes:
-Contacts
-All Fields tab
-All Contact Fields
-User Field 4 & enter a value of "HH"

I had imagined I'd just go into Macro and say "start recording keystrokes"
but that doesn't seem to exist. Correct?


Correct.

Then I thought I could write something in VBA but I'm a VBA novice and I
don't quite know how to do what I want. Does anyone know/have any code
that
would do this?


ActiveInspector.CurrentItem.User4 = "HH"

And if it can be done w/ VBA, can I trigger it from a hotkey combination
or
a custom toolbar button?

[snip]

Custom Toolbar Button is trivial: (View/Toolbar/Customize...). To add a
keyboard shortcut, see http://support.microsoft.com/?kbid=252427.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



  #4  
Old February 18th 06, 04:51 PM posted to microsoft.public.outlook.program_vba
Rich Roller
external usenet poster
 
Posts: 8
Default Automate keystrokes w/ VBA?

Yes custom toolbar buttons are easy... but do you know how to get the button
to display ONLY in the standard Contacts form but not in other
screens/forms? (After I added the button in Contacts, it's also showing up
in message views/forms)

Thanks again.

-Rich

"Michael Bednarek" wrote in message
...
On Fri, 17 Feb 2006 13:37:43 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:


Custom Toolbar Button is trivial: (View/Toolbar/Customize...). To add a
keyboard shortcut, see http://support.microsoft.com/?kbid=252427.



  #5  
Old February 19th 06, 10:02 AM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default Automate keystrokes w/ VBA?

On Sat, 18 Feb 2006 10:51:54 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:

Yes custom toolbar buttons are easy... but do you know how to get the button
to display ONLY in the standard Contacts form but not in other
screens/forms? (After I added the button in Contacts, it's also showing up
in message views/forms)


I don't know. I suspect you would have to create and publish a form for
your contacts. There's another newsgroup which seems to deal with that:
microsoft.public.outlook.program_forms

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #6  
Old February 19th 06, 02:50 PM posted to microsoft.public.outlook.program_vba
Rich Roller
external usenet poster
 
Posts: 8
Default Automate keystrokes w/ VBA?

I'll try to find the answer for that.

Thanks again for the simple but crucial VBA syntax you gave me!

-Rich

"Michael Bednarek" wrote in message
...
On Sat, 18 Feb 2006 10:51:54 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:

Yes custom toolbar buttons are easy... but do you know how to get the
button
to display ONLY in the standard Contacts form but not in other
screens/forms? (After I added the button in Contacts, it's also showing
up
in message views/forms)


I don't know. I suspect you would have to create and publish a form for
your contacts. There's another newsgroup which seems to deal with that:
microsoft.public.outlook.program_forms

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



  #7  
Old February 19th 06, 11:38 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Automate keystrokes w/ VBA?

Can't you just test for Inspector.CurrentItem = olContact when you create
your button? Don't create the button if the test is True.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Rich Roller" wrote in message
...
I'll try to find the answer for that.

Thanks again for the simple but crucial VBA syntax you gave me!

-Rich

"Michael Bednarek" wrote in message
...
On Sat, 18 Feb 2006 10:51:54 -0500, Rich Roller wrote in
microsoft.public.outlook.program_vba:

Yes custom toolbar buttons are easy... but do you know how to get the
button
to display ONLY in the standard Contacts form but not in other
screens/forms? (After I added the button in Contacts, it's also showing
up
in message views/forms)


I don't know. I suspect you would have to create and publish a form for
your contacts. There's another newsgroup which seems to deal with that:
microsoft.public.outlook.program_forms

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"




  #8  
Old February 20th 06, 07:40 AM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default Automate keystrokes w/ VBA?

On Sun, 19 Feb 2006 17:38:25 -0500, "Ken Slovak - [MVP - Outlook]" wrote
in microsoft.public.outlook.program_vba:

Can't you just test for Inspector.CurrentItem = olContact when you create


(Shouldn't that be: Inspector.CurrentItem.Class = olContact ?)

your button? Don't create the button if the test is True.


That assumes the OP creates the button programmatically via an event
handler; I doubt that.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #9  
Old February 20th 06, 03:39 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Automate keystrokes w/ VBA?

Yes, sorry, Inspector.CurrentItem.Class = olContact.

The button should be created in an event handler for NewInspector, that's
the best way to do it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael Bednarek" wrote in message
...
On Sun, 19 Feb 2006 17:38:25 -0500, "Ken Slovak - [MVP - Outlook]" wrote
in microsoft.public.outlook.program_vba:

Can't you just test for Inspector.CurrentItem = olContact when you create


(Shouldn't that be: Inspector.CurrentItem.Class = olContact ?)

your button? Don't create the button if the test is True.


That assumes the OP creates the button programmatically via an event
handler; I doubt that.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"


  #10  
Old February 23rd 06, 06:40 AM posted to microsoft.public.outlook.program_vba
Rich Roller
external usenet poster
 
Posts: 8
Default Automate keystrokes w/ VBA?

Guys I'm not sure I totally follow.

I know how to create a button via the add/remove GUI (customize toolbar) but
how do I create a button conditionally? "in an event handler"? Or is it
possible to edit the properties of the button once it's created to make it
display conditionally (only if in Contacts form/view)?

Again, I'm novice programming so it'd have to be pretty easy, as was the
above tip for jumping to a specific field.

-Rich

"Ken Slovak - [MVP - Outlook]" wrote in message
...
Yes, sorry, Inspector.CurrentItem.Class = olContact.

The button should be created in an event handler for NewInspector, that's
the best way to do it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael Bednarek" wrote in message
...
On Sun, 19 Feb 2006 17:38:25 -0500, "Ken Slovak - [MVP - Outlook]" wrote
in microsoft.public.outlook.program_vba:

Can't you just test for Inspector.CurrentItem = olContact when you create


(Shouldn't that be: Inspector.CurrentItem.Class = olContact ?)

your button? Don't create the button if the test is True.


That assumes the OP creates the button programmatically via an event
handler; I doubt that.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate Outlook username and server Sam Stamp Outlook - Installation 2 December 13th 07 08:02 AM
Creating own rules using VBA? Michael Mueller Outlook and VBA 2 February 16th 06 02:54 PM
Automate mail account creation? Doug Outlook - Installation 2 February 8th 06 07:03 PM
How to automate sending email with different attachments Xluser@work Outlook and VBA 3 January 25th 06 05:33 AM
Automate Outlook Profiles ... Newprof and PRF DemoDog Outlook - Installation 3 January 17th 06 03:06 PM


All times are GMT +1. The time now is 08:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.