• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Vbscript, Win NT and IE5

ok here is my question, I have a simple script that uses outlook to add contacts and appointments. Now this script seems to work on computers with Win95 and IE4. But when I try running it from a computer with Win NT and IE5 it gives me this error"ActiveX component can't create object 'outlook.application'. Now the computer with Win Nt has Outlook as it's mail program. Here is the code:
Sub NewAppointment (strSubject, strLocation, _
      strStart, strDuration)
      'Create Outlook Object
      Set App = CreateObject("Outlook.Application")
      Set MyNameSpace = App.GetNamespace("MAPI")

      'Add Apointment
      Set AppointmentFolder = MyNameSpace.GetDefaultFolder(9)
      Set AppointmentItem = AppointmentFolder.Items.Add
      AppointmentItem.Subject = strSubject
      AppointmentItem.Location = strLocation
      AppointmentItem.Start = strStart
      AppointmentItem.Duration = strDuration

      'Send Message To Instructor - maybe not for now
      'Set MailFolder = MyNameSpace.GetDefaultFolder(4)
      'Set MailItem = MailFolder.Items.Add
      'MailItem.To = "soandso.com"
      'MailItem.Subject = "New Class Attendee for: " & strSubject
      'MailItem.Body = "Date: " & strStart

      MsgBox "This event has been added to your Outlook!"
end SUB

Sub NewContact(strName, strCompany, strAddress, _
      strPhone, strEmail)
      'Create Outlook Object
      Set App = CreateObject("Outlook.Application")
      Set MyNameSpace = App.GetNamespace("MAPI")

      'Add Contact
      Set ContactFolder = MyNameSpace.GetDefaultFolder(10)
      Set ContactItem = ContactFolder.Items.Add
      ContactItem.FullName = strName
      ContactItem.CompanyName = strCompany
      ContactItem.BusinessAddress = strAddress
      ContactItem.BusinessTelephoneNumber = strPhone
      ContactItem.Email1Address = strEmail
      MsgBox "This event has been added to your Outlook Contacts!"
end SUB

      <INPUT TYPE="BUTTON" VALUE="Appointment"
      OnClick="NewAppointment 'Microsoft Outlook Object Model', 'Classroom1', '6/24/99 12:30 PM', '30'">
      <INPUT TYPE="BUTTON" VALUE="Contact"
      OnClick="NewContact 'Miguel Cuevas', 'Taylor & Associates Architects', '2220 North University Drive', '(949)555-5555', 'mcuevas@taa1.com'">
Any help is appreciated.

  • 2
1 Solution
It's possible that this has to do with permissions in IE5.  I believe they changed a little from IE4.

Check the security settings in both browsers.

Could also have something to do with NT permissions, since W95 has effectively no file security.

Have you tried to run on Win95/IE5 and/or NT/IE4?

Might be registering problem.
Try to register once again that particular dll(Outlook.dll) in the NT machine and check whether it is working.
mcuevasAuthor Commented:
Thanks TTom, it was the security.
Sometimes I even amaze myself!  If I keep going this way, I will actually get to the point where I think I know something.  Of course, then they will go and change it all <G>

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now