Add VBA code to an existing form

R

Ryan Zwahr

Hi,
I'm brand new to VBA, so this is probably an obvious question:

I've got an existing outlook custom contact form that I have posted to
a public folder. I want to add a command button to this existing form
which will open a custom contact report (word template) and stuff data
into it. I found a great example of this in Sue's book. Where I am
lacking is, I don't know exactly where to add it.

In Sue's book she shows forms being opened and edited within the vba
environment. I am not sure how to open my form in this environment.
I did not create this form in vba environment, but rather through
opening the default contact form, clicking Tools - Forms - Design this
Form and doing it from there. I did find that there is an option when
designing the form called View Code, but I don't know if that is what
I am after. I know how to go into outlook and open the Visual basic
environment by going to Macros - Visual Basic, yet I can't figure out
how to "browse" or otherwise get my form into that environment so I
can add code to it. How do you add vba code to an already existing,
published form?

outlook version - 2003
platform - Windows XP
server - Exchange 2003

Thanks,
Ryan
 
S

Sue Mosher [MVP-Outlook]

You don't. Outlook forms run VBScript, not VBA. My recommendation is that
you prototype your code in VBA, which is a much better coding environment,
then port it to VBScript by following the instructions in the book for
removing variable and procedure data typing, adding constant declarations or
literals, etc. An Outlook form in design mode has a View Code button that
opens the (minimalist) code window.
 

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