This procedure uses the Click event to call CreateItem to create and show an appointment when a user clicks CommandButton1.
In design mode:
- Using the Control Toolbox, place a CommandButton on your form.
- Open the Script Editor.
How?
- Enter the following code, using the value from the table below to specify the type of item that you want to create.
Sub CommandButton1_Click Application.CreateItem(1).Display End Sub
Type of item | Has the value |
---|---|
MailItem | 0 |
AppointmentItem | 1 |
ContactItem | 2 |
TaskItem | 3 |
JournalItem | 4 |
NoteItem | 5 |
PostItem | 6 |
DistListItem | 7 |