Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Vbscript, Win NT and IE5

Posted on 1999-06-24
Medium Priority
Last Modified: 2013-12-25
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 = ""
      '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', ''">
Any help is appreciated.

Question by:mcuevas
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1863500
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?


Expert Comment

ID: 1863501
Might be registering problem.
Try to register once again that particular dll(Outlook.dll) in the NT machine and check whether it is working.

Author Comment

ID: 1863502
Thanks TTom, it was the security.

Accepted Solution

TTom earned 400 total points
ID: 1863503
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>


Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question