Solved

Post form fields onto calendar

Posted on 2002-07-26
2
146 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 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

696 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