Modifying the built in forms with VBA

Status
Not open for further replies.

vincetaylor

Senior Member
Outlook version
Outlook 2016 64 bit
Email Account
Exchange Server
I created an Outlook form by taking one of the existing built in forms in my personal folder and adding new fields.
I would now like to make some changes that require code. As an example, I would like to add VB code to the form that says if the Summary field is empty then the name field becomes inactive

Question: How do I access and modify the code for this form?


I clicked on the "View Code" button and it displays an empty file

When I clicked on the Visual Basic button, I don't see the code for this form. I only see a generic form called UserForm1. See image below

vb.png


vb2.jpg
 
Another question I have is about publishing a form created in VBA

Question: Once you create a form in VBA, How does one Publish the form to one of the Libraries e.g. Standard Forms Library or Organizational forms Library or Person forms library.

How for example would I publish Userform1 above for use by myself or others ?
I don't see the Publish option in VBA
 
You click View code - but need to add the code. If all you need to di is make sure a field has a value, use Validation. Right click on he field, choose properties then Validation.

2020-10-21_10-31-06-0000.png




When you save the entry with the field blank
2020-10-21_10-31-10-0000.png





Question: Once you create a form in VBA, How does one Publish the form to one of the Libraries e.g. Standard Forms Library or Organizational forms Library or Person forms library.
You don't publish it using VBA. :) If you are not using Exchange with an organizational forms library or publishing it to a shared folder, you'll need to give the form to the others to share it. They'll publish it to their personal library.

 
Hi Diane
Thank you very much for your response. I am only now starting out with VBA for Outlook forms.

I clicked on the View Code button to open the editor. Then I tried some basic code to see if I could control a button. Then I saved and published
But when I run the form click on the button, nothing happens

The Code I tried is

Sub CommandButton1_Click()
msgbox "Hello World"
End Sub

Why am I still unable to control the button?

vb5.JPG

vb3.JPG

vb4.JPG
 
Just FYI. I have also enabled macros. I would like to get this basic code working so I can proceed with learning on the job

vb7.JPG
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
I Outlook 2013 Modifying an Outlook calendar Using Outlook.com accounts in Outlook 0
M Modifying BCM Database using Access BCM (Business Contact Manager) 1
M Modifying Macro MoveAgedMail(2) - use categories & "to" as variable Using Outlook 12
B modifying print template for printing out appointment details Using Outlook 2
S Automatically modifying an email Outlook VBA and Custom Forms 3
U Creating or modifying Outlook .Nk2 file in C# Outlook VBA and Custom Forms 1
A Expected behauvior when modifying properties? Outlook 2003. Outlook VBA and Custom Forms 3
C Beginner Needs VBA Help in Modifying Code Outlook VBA and Custom Forms 2
J Modifying a Business Contact Manager Report BCM (Business Contact Manager) 1
A Accessing full contact forms Using Outlook 2
S Adding Custom Forms Outlook VBA and Custom Forms 4
V How to use Comas in a picklist in Outlook forms Outlook VBA and Custom Forms 3
D Outlook 365 Custom forms field limit? Outlook VBA and Custom Forms 4
V Is it possible to collect statistics from Outlook forms? Outlook VBA and Custom Forms 1
V Outlook Forms: Formatting a Label with 2 different styles Outlook VBA and Custom Forms 1
F KB4475563 stops VBS at forms working Outlook VBA and Custom Forms 3
N Creating a button or link to a form in the Organizational Forms Library Outlook VBA and Custom Forms 3
N Outlook Forms Help Outlook VBA and Custom Forms 2
M other user's mailbox won't open, forms disappeared Using Outlook 42
J Backup .OST - Custom Contact Forms, Defined Fields, Notes Using Outlook 1
B Outlook Custom forms Using Outlook 0
Diane Poremsky Organizational Forms Library in Exchange 2010 Using Outlook 0
Diane Poremsky Create an Organizational Forms Library Using Outlook 0
Diane Poremsky Create an Organizational Forms Library in Exchange 2013 or Office 365 Using Outlook 0
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
Cameron Piper Automatically update custom forms across multiple computers Outlook VBA and Custom Forms 1
F Organizational Forms usage Exchange Server Administration 1
K Export Organizational Forms Library Exchange Server Administration 1
N Export Outlook custom forms fields to excel Outlook VBA and Custom Forms 1
Diane Poremsky How to clean up Outlook's Forms Cache Using Outlook 0
X Bulk edit Contact forms Using Outlook 2
Diane Poremsky Designing Custom Outlook Forms Using Outlook 0
Diane Poremsky Create an Organizational Forms Library in Exchange 2013 Using Outlook 1
Diane Poremsky Publishing Custom Forms Using Outlook 0
G Message template / custom forms and VBA Help needed - inserting info into table Outlook VBA and Custom Forms 3
N How to disable user defined fields in BCM forms Using Outlook 2
N Passing Attachments between forms? Outlook VBA and Custom Forms 2
Nick Truscott Lost custom forms after moving mailbox Outlook VBA and Custom Forms 3
S How to remove forms from Organizational forms library Outlook VBA and Custom Forms 2
G Outlook forms text input Outlook VBA and Custom Forms 1
H Lost Custom Forms when we replaced Exchange Server Outlook VBA and Custom Forms 3
J Outlook 2013 Forms Issue Using Outlook 1
N Outlook Forms Not Displaying Outlook VBA and Custom Forms 6
D Using Follup in Custom Forms Outlook 2013 Using Outlook 9
P Custom Forms in Reading/Viewing Pane Using Outlook 1
D Move Personal Forms Library Outlook VBA and Custom Forms 10
C Custom Forms: Question about retaining form information throughout the entire conversation Outlook VBA and Custom Forms 2

Similar threads

Back
Top