Microsoft KB Archive/165673

= How To Performing OLE Automation with Visual Basic Script 1.0 =

Article ID: 165673

Article Last Modified on 8/8/2007

-

APPLIES TO


 * Microsoft Visual Basic, Scripting Edition 1.0

-



This article was previously published under Q165673



SUMMARY
Visual Basic Scripting Edition (VBScript) version 1.0 does not support the CreateObject function that is available in Visual Basic for Applications (VBA). The HTML object tag can be used in conjunction with Visual Basic Scripting to automate any OLE Automation server.

NOTE: VBScript 2.0 (and higher) now supports the CreateObject function. However, this version does not ship with the current version of Internet Explorer 3.0. For more information on obtaining the latest version of VBScript, see the following Web site:

http://msdn2.microsoft.com/en-us/library/ms950396.aspx



MORE INFORMATION
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

The following example demonstrates how the HTML object tag and Visual Basic Scripting can be used to send a message with the OLE Messaging Automation Object.

NOTE: Replace objOneRecip.Name = "Some Name" with a valid recipient name:

  Sample Script to Send a MessagePage    

 Dim oSession, objMessage, objOneRecip MAPI.Logon Set objMessage = MAPI.Outbox.Messages.Add Set objOneRecip = objMessage.Recipients.Add objOneRecip.Name = "Some Name" objOneRecip.Type = 1 objOneRecip.Resolve 1 objMessage.subject = "Test MAPI/OLE VB Message w/ole object - explicit" objMessage.Text = "Like you really wanted this.. Please Delete this test" objMessage.Send 0,0,0

  

Additional query words: KbsweptIE5000 May-03-1999

Keywords: kbhowto kbinterop KB165673

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.