Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Post form fields onto calendar

Posted on 2002-07-26
2
Medium Priority
?
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 800 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

609 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