Solved

Post form fields onto calendar

Posted on 2002-07-26
2
144 Views
Last Modified: 2013-12-26
I have an outlook form that I am designing.  It is a function catering form.  What I want to do is that whenever someone completes the form, I want that form to post the date,time, subject and userid into an public calendar folder (named catering).

Can anybody help me or steer me into the right direction?
0
Comment
Question by:vhooper780
2 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 200 total points
ID: 7183065
Here's a quick example of how to find the "catering" folder and adding a new appointment item. Make sure you add a reference to "Microsoft Outlook"

Private Sub cmdAddAppointment_Click()

   Dim olApp As New Outlook.Application
   Dim olSession As Outlook.NameSpace
   Dim olCaterFolder As Outlook.MAPIFolder
   Dim olApptItem As Outlook.AppointmentItem
   
   ' Get a reference to the session.
   Set olSession = olApp.GetNamespace("MAPI")

    ' Find the catering folder starting at the root
    Set olCaterFolder = ProcessFolder(olSession.Folders(1))
    If olCaterFolder Is Nothing Then
        MsgBox "folder not found"
        Exit Sub
    End If
   
    ' Add the new appointment item to the catering folder
    Set olApptItem = olCaterFolder.Items.Add
    olApptItem.Subject = "The subject"
    olApptItem.Start = Now()
    olApptItem.Save
   
End Sub

Private Function FindFolder(CurrentFolder As Outlook.MAPIFolder) As MAPIFolder
    Dim olNewFolder As Outlook.MAPIFolder
   
   ' Loop through and search each subfolder of the current folder.
   For Each olNewFolder In CurrentFolder.Folders
       
        ' If we have a match, return the folder object and exit
        If olNewFolder.Name = "catering" And olNewFolder.DefaultItemType = olAppointmentItem Then
            Set FindFolder = olNewFolder
            Exit Function
        End If
       
        ' Recurse any subfolders in the current folder.
        Set FindFolder = FindFolder(olNewFolder, sName, sType)
        ' If a folder object was returned the target was found; exit...
        If Not FindFolder Is Nothing Then Exit Function
       
   Next
   
End Function

-----------------------------------------------------

A good resource for Outlook related info is
www.slipstick.com
There is section on custom forms which shows how to retrieve form fields that you can incorporate into the above example.
0
 

Author Comment

by:vhooper780
ID: 7185164
Thanks, I believe I can work with this.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question