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