XL7: Visual Basic Macro to Insert Data in Schedule+Last reviewed: September 2, 1997Article ID: Q138284 |
The information in this article applies to:
SUMMARYMicrosoft Schedule+ for Windows 95, version 7.0, can be programmatically controlled through Visual Basic for applications. The following example takes data from a Microsoft Excel worksheet and places it in the Contacts database in Microsoft Schedule+.
MORE INFORMATIONMicrosoft provides examples of Visual Basic for applications procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.
Sample Macro
Sub Place_Data_From_XL_Into_Contacts() Dim objSched, objTable, objItem As Object ' Sets a variable to the caption of Excel CurApp = Application.Caption ' Creates the schedule+ object Set objSched = CreateObject("scheduleplus.application.7") ' Checks to see if you are logged on to Schedule+ If Not objSched.LoggedOn Then AppActivate CurApp 'activates Excel ' Prompts you for you email name UserName = Application.InputBox("Please Enter Your Email Name") objSched.Logon UserName, "", True 'logs you into schedule+ End If ' Creates the contacts database object Set objTable = objSched.ScheduleSelected.Contacts With Worksheets("Sheet1") ' Starts a loop from 1 to the number of rows of data For i = 2 To .Range(.Range("a2"), _ .Range("a2").End(xlDown)).Rows.Count Set objItem = objTable.New ' Creates a blank new entry in the ' table ' Creates new entries in the contacts database ' using the values in the appropriate cells 'The following three lines need to be on one line objItem.SetProperties FirstName:=.Range("a" & i).Value, _ LastName:=.Range("b" & i).Value, _ PhoneBusiness:=.Range("c" & i).Value, _ PhoneHome:=.Range("d" & i).Value Next i 'returns to the top of the loop End With End Sub To test the sample macro
REFERENCESFor more information about OLE Automation, click the Index tab in Microsoft Help, type the following text
OLE Automationclick the OLE Automation topic, and click the OLE Automation topic in the list of topics found to go to the "OLE Automation" topic. For more information about programming with Microsoft Schedule+ for Windows 95, version 7.0, you need to have the Microsoft BackOffice Software Development Kit (SDK) installed. In Microsoft BackOffice SDK in the Entire Contents pane, choose Microsoft Exchange Server. There will be a sub-level entitled Microsoft Schedule+ Programmer's Guide.
|
Additional query words: 7.00 howto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |