• Writing To A Calendar from a User Form? (Outlook 2000/2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Outlook and email programs » Writing To A Calendar from a User Form? (Outlook 2000/2002)

    Author
    Topic
    #372985

    Requirement.
    To have a User Form that Prompts for Dept, Start and End dates (I already Have this)
    I have a custom CalendarFolder set up (Let’s call it AndrewsCalendar) for now. This will be a shared Calendar.
    I want the form to automatically write the Dept, UserName, Start and End dates into the Calendar with Name and Dept as Subject.

    I can get it to do this in VBA but only to the default calendar.
    How do I get it to write to a specified calendar.
    I am using a UserForm from VBA from a toolbar button.
    Is there a better way?

    Also, I am struggling on getting the UserName in

    Any Help would be good.

    Code on the form at the moment is as below:

    Private Sub cmdSubmit_Click()

    Dim strMsg As String
    Dim oOUT As New Outlook.Application
    Dim oAPP As Outlook.AppointmentItem, oCal As Object

    ‘Check fields
    If Len(cboDept) = 0 Then
    MsgBox “Department must be selected”
    cboDept.SetFocus
    Exit Sub
    End If

    If Len(txtStart) = 0 Then
    MsgBox “Start Date must be selected”
    txtStart.SetFocus
    Exit Sub
    End If

    If Len(txtEnd) = 0 Then
    MsgBox “End Date must be selected”
    txtEnd.SetFocus
    Exit Sub
    End If

    ‘All Selected so carry on
    strMsg = “You have Entered a Holiday entry for ” & vbLf & “Department : ” & cboDept & _
    vbLf & “Starting on ” & Format(txtStart, “dd-mmm-yyyy”) & vbLf _
    & “Finishing on ” & Format(txtEnd, “dd-mmm-yyyy”) & vbLf _
    & “All being ” & IIf(optHalf = True, ” Half Days”, ” Full Days”)

    ‘Here goes the Calendar update code

    Set oAPP = oOUT.CreateItem(olAppointmentItem)

    ‘Now add the items to the Calendar

    oAPP.Start = txtStart
    oAPP.End = txtEnd
    oAPP.Subject = “Holiday – ” & cboDept
    oAPP.Save

    ‘Tidy Up
    Set oAPP = Nothing
    Set oOUT = Nothing

    MsgBox strMsg
    Unload Me

    End Sub

    Also Digital Signatures….
    On Outlook 2002 I am getting stitched up by the Security.
    My VBProject is NOT digitally signed and the only signature I have available is NO good.
    Short of running on Minimum security level (Not Good)
    How do I get a valid digital signature for this project?

    Any help gratefully accepted

    Viewing 0 reply threads
    Author
    Replies
    • #599623

      On the Digital Signature, have you tried using Self-Cert.exe in the Program FilesMicrosoft OfficeOffice folder? HTH

    Viewing 0 reply threads
    Reply To: Writing To A Calendar from a User Form? (Outlook 2000/2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: