Appointment Forms - Help a Newbie

  • Thread starter Thread starter wholive
  • Start date Start date
W

wholive

I have been doing some work with VB Scripts and Outlook Express tryin
to configure the Appointment forms to work better within ou
enviornment. Yes I am very new at this.

Now Outlook does not want to allow me to configure the standard form
so I have been trying to play some games with them.

I was wondering if someone could answer a couple questions...

1) Is it possible to simulate someone clicking a command button from
VB script (for instance if a condition is met before the save event
how can I cause a command button to *be* clicked to preform tha
command)?

2) How can I open a dialog box from script (for instance the Categorie
Dialog Box)?
 
1) Do you mean a command button control that you placed on a custom form or
a toolbar or menu command?

2) Outlook version?
 
Hi,

A better approach might be to create your custom form,
publish it (DON'T save changes, just publish it), then set
it to be the default for Appointments, at which point all
new Appointments will use your form. Right click on the
Calendar, go to Properties, then change "When posting to
this folder, use" to your form.

In order to get existing appointments to use your form,
you will have to run some VBA code- or change each one
manually!

I did the same thing with Contacts forms. Here's the code
I used (note that you will have to make some changes for
it to work with Appointments instead of Contacts):

'*************[ BEGIN CODE ]*******************
' Put this code in "ThisOutlookSession" near the bottom.
To Run it: Ctrl+F8, then choose "ChangeContactForm".

'***

Public Sub ChangeContactForm()
'Purpose: change all existing Contacts to use the
'new form I created

Err.Clear

Dim appOl As Outlook.Application
Dim nmsNS As NameSpace
Dim strNew As String
Dim fldContacts As MAPIFolder
Dim itmItems As Items
Dim itmContact As Object

strNew = "IPM.Contact.SendFax"
'Declare itmContact as Object and check the value
'of the Class property


Set appOl = CreateObject("Outlook.Application")
Set nmsNS = appOl.GetNamespace("MAPI")
Set fldContacts = nmsNS.GetDefaultFolder
(olFolderContacts)
Set itmItems = fldContacts.Items

'Loop through items in the folder:
For Each itmContact In itmItems
With itmContact
' Message class needs to be changed - ?
If .Class = olContact Then
If .MessageClass <> strNew Then
' Change the message class:
.MessageClass = strNew
' Save it
.Save
End If
End If
End With
If Err.Number <> 0 Then
MsgBox Err.Number & " " & Err.Description &
vbCrLf & _
itmContact.FullNameAndCompany
End If
Next

If Err.Number = 0 Then
MsgBox "All done."
Else
MsgBox Err.Number & " " & Err.Description
End If

End Sub
'*************[ END CODE ]*********************


I hope this helps you out.

-Andrew Cushen
 
Back
Top