+ Reply to Thread
Results 1 to 5 of 5

Why does Outlook.Application.GetNamespace("MAPI") Fail?

  1. #1
    Lee
    Guest

    Why does Outlook.Application.GetNamespace("MAPI") Fail?

    Can anyone point me in the direction as to why the following fails?

    Set NS = Outlook.Application.GetNamespace("MAPI")

    It is done on a server that only has outlook and exel installed (Excel is
    the full instlal, outlook is only partially).
    --
    -Lee

  2. #2
    Tom Ogilvy
    Guest

    Re: Why does Outlook.Application.GetNamespace("MAPI") Fail?

    Set NS = Application.GetObject("Outlook.Application").GetNamespace("MAPI")

    Would be more what your are looking for. This would require Outlook to be
    running at the time.

    If it isn't running, use CreateObject instead. See VBA help on GetObject
    and CreateObject for examples and explanations.

    --
    Regards,
    Tom Ogilvy

    "Lee" <[email protected]> wrote in message
    news:[email protected]...
    > Can anyone point me in the direction as to why the following fails?
    >
    > Set NS = Outlook.Application.GetNamespace("MAPI")
    >
    > It is done on a server that only has outlook and exel installed (Excel is
    > the full instlal, outlook is only partially).
    > --
    > -Lee




  3. #3
    Shadhi
    Guest

    RE: Why does Outlook.Application.GetNamespace("MAPI") Fail?

    Hi Lee,
    I believe the MAPI namespace only works if Outlook is configured for
    CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the other
    option is). Also, the MAPI namespace is a connection to an MS Exchange
    Server, so a "partial" install of Outlook may not be enough to allow you to
    use the MAPI namespace. Another possible cause of the problem: trying to get
    to the namespace without an instance of the Outlook Application object. Try
    this instead:

    set myOutApp = GetObject("Outlook.Application")
    set NS = myOutApp.GetNamespace("MAPI")

    Using GetObject will allow you to use an existing instance of Outlook, if
    there is one; otherwise it will create a new instance. If you prefer to
    create a new instance anyway, change the first line to:
    set myOutApp = new Outlook.Application

    Hope this helps!

    Shadhi

    "Lee" wrote:

    > Can anyone point me in the direction as to why the following fails?
    >
    > Set NS = Outlook.Application.GetNamespace("MAPI")
    >
    > It is done on a server that only has outlook and exel installed (Excel is
    > the full instlal, outlook is only partially).
    > --
    > -Lee


  4. #4
    Lee
    Guest

    RE: Why does Outlook.Application.GetNamespace("MAPI") Fail?

    Okay, I found the problem. It is saying I am missing a .dll file. Does
    anyone know what the .dll file I would need for this, its really Excel
    running an outlook method. Thanks.
    --
    -Lee


    "Shadhi" wrote:

    > Hi Lee,
    > I believe the MAPI namespace only works if Outlook is configured for
    > CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the other
    > option is). Also, the MAPI namespace is a connection to an MS Exchange
    > Server, so a "partial" install of Outlook may not be enough to allow you to
    > use the MAPI namespace. Another possible cause of the problem: trying to get
    > to the namespace without an instance of the Outlook Application object. Try
    > this instead:
    >
    > set myOutApp = GetObject("Outlook.Application")
    > set NS = myOutApp.GetNamespace("MAPI")
    >
    > Using GetObject will allow you to use an existing instance of Outlook, if
    > there is one; otherwise it will create a new instance. If you prefer to
    > create a new instance anyway, change the first line to:
    > set myOutApp = new Outlook.Application
    >
    > Hope this helps!
    >
    > Shadhi
    >
    > "Lee" wrote:
    >
    > > Can anyone point me in the direction as to why the following fails?
    > >
    > > Set NS = Outlook.Application.GetNamespace("MAPI")
    > >
    > > It is done on a server that only has outlook and exel installed (Excel is
    > > the full instlal, outlook is only partially).
    > > --
    > > -Lee


  5. #5
    Tom Ogilvy
    Guest

    Re: Why does Outlook.Application.GetNamespace("MAPI") Fail?

    Why not try an Outlook group. You have departed from any dependence on
    Excel.

    --
    Regards,
    Tom Ogilvy


    "Lee" <[email protected]> wrote in message
    news:[email protected]...
    > Okay, I found the problem. It is saying I am missing a .dll file. Does
    > anyone know what the .dll file I would need for this, its really Excel
    > running an outlook method. Thanks.
    > --
    > -Lee
    >
    >
    > "Shadhi" wrote:
    >
    > > Hi Lee,
    > > I believe the MAPI namespace only works if Outlook is configured

    for
    > > CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the

    other
    > > option is). Also, the MAPI namespace is a connection to an MS Exchange
    > > Server, so a "partial" install of Outlook may not be enough to allow you

    to
    > > use the MAPI namespace. Another possible cause of the problem: trying

    to get
    > > to the namespace without an instance of the Outlook Application object.

    Try
    > > this instead:
    > >
    > > set myOutApp = GetObject("Outlook.Application")
    > > set NS = myOutApp.GetNamespace("MAPI")
    > >
    > > Using GetObject will allow you to use an existing instance of Outlook,

    if
    > > there is one; otherwise it will create a new instance. If you prefer to
    > > create a new instance anyway, change the first line to:
    > > set myOutApp = new Outlook.Application
    > >
    > > Hope this helps!
    > >
    > > Shadhi
    > >
    > > "Lee" wrote:
    > >
    > > > Can anyone point me in the direction as to why the following fails?
    > > >
    > > > Set NS = Outlook.Application.GetNamespace("MAPI")
    > > >
    > > > It is done on a server that only has outlook and exel installed (Excel

    is
    > > > the full instlal, outlook is only partially).
    > > > --
    > > > -Lee




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1