Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    New York, NY
    Thanked 12 Times in 11 Posts

    VBA Impaired (Outlook 2003)

    I installed Office 2003 on a new PC. I am using the same files which I use on another PC, but I seem to be hitting a brick wall in Outlook.

    I have code (see Sub below) in Word which activates Outlook Contacts if Outlook Contact folder is currently open. Otherwise, the code launches Outlook with the Contacts folder active. The code works as expected to activate, but it will not launch Outlook when that is necessary. The Reference to Outlook 11 is set.

    In Outlook itself, I have a macro which launches an EXE which creates a data file from the currently selected Outlook Contacts, using Outlook Redemption. This appears not to run. If I double click on the EXE in Winrdows Explorer, nothing happens. Given the situation with the Word code, I'm assuming that the problem is with Outlook, not my EXE.

    If I add MsgBox "test" at the top of my Outlook macro, the message box displays as expected. So it would appear that some code will run, but not other pieces.

    When Outlook starts, there is a message which displays. The caption reads: Internet Explorer Script Error. The message: "An error has occured in the script on this page. Line: 298 Char 1 Error: Class not registered Code: 0 URL: outlook:today. Do you want to continue running scripts on this page? yes no" I have answer bother yes and no.... no change in the above problem.

    Any ideas what might be wrong? As I mentioned, this works perfectly on another PC (and about 500 PCs at a client's office). Is there something that I might have missed when I installed Office 2003?

    Richard Barrett

    Word macro:
    Sub GoToOutlookContacts()
    ' Requires reference to Outlook 11
    If Tasks.Exists("Contacts") Then
    Tasks("Contacts").WindowState = wdWindowStateNormal
    Dim olApp As Outlook.Application
    Dim olNS As Outlook.NameSpace
    Dim olContacts As Outlook.MAPIFolder
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If olApp Is Nothing Then _
    Set olApp = CreateObject("Outlook.Application")
    olApp.Visible = True
    Set olNS = olApp.GetNamespace("MAPI")
    Set olContacts = olNS.GetDefaultFolder(olFolderContacts)
    End If
    End Sub

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: VBA Impaired (Outlook 2003)

    <P ID="edit" class=small>(Edited by jscher2000 on 03-May-05 22:24. Added a note on Outlook Today.
    )</P>Regarding the Word macro:

    You might need to return to normal error handling (On Error Goto 0) before calling CreateObject to see if that itself is returning an error.

    Regarding Outlook Today:

    There must be a way to determine which ActiveX control is the problem, but it's a little beyond what I can do in the middle of the night tonight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts