Article ID: 147633
Article Last Modified on 1/19/2007
Command button:
Name: RunSchedulePlus
Caption: Start Schedule+
OnClick: =StartSchedPlus()
'--------------------------------------------------------------------
' This function sets an object variable to the Schedule+ Application
' object using the CreateObject() function. Then, it checks
' the LoggedOn data member to determine if the current user is
' logged-on. If not, it displays an InputBox for entering a user
' profile and then logs-on to Schedule+. Once logged on, the procedure
' uses the ScheduleLogged data member to return a schedule for the
' current user.
'--------------------------------------------------------------------
Public Function StartSchedPlus()
On Error GoTo StartSchedPlus_Error
Dim spObj As Object, spSchedule As Object
Dim UserName As String
' Create a Schedule+ object.
Set spObj = CreateObject("SchedulePlus.Application")
' Determine if user is logged on to Schedule+.
If Not spObj.LoggedOn Then
UserName = InputBox("Please enter your profile name." & _
Chr(13) & Chr(13) & "Example: Nancy Davolio")
spObj.Logon UserName, " ", True
End If
Set spSchedule = spObj.ScheduleLogged
spSchedule.Activate
Exit Function
StartSchedPlus_Error:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function161012 VBA: How to Create a New Contact Item in Outlook with Automation
Keywords: kbhowto kbinterop kbprogramming KB147633