Solved

Post form fields onto calendar

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
A macro to Count the number of rows across all worksheets 3 151
TT Auto Dashboard 13 101
MsgBox 4 71
VB 6 error 5 in windows 10 but not in XP 7 67
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…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

730 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