The type or namespace name 'OutLook' could not be found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mnarewec
    New Member
    • Nov 2007
    • 22

    The type or namespace name 'OutLook' could not be found

    The type or namespace name 'OutLook' could not be found (are you missing a using directive or an assembly reference?)

    Actually I am trying to follow an example shown in the article:
    http://support.microso ft.com/kb/895940

    but its giving the above error eventhought I add the Reference Microsoft Outlook 11.0 Object library.

    I am using VS 2005 Professional Edition.

    Here is my code:

    Code:
    using System;
    using System.Windows.Forms;
    using [B]Outlook;[/B]
    using OutLookApp = [B]Outlook[/B].Application;
    What more directives or references am I missing. Please assist
    Thank you
    Rei Masi
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Seems somehow the example skips on how to skip all the namespaces they have.

    I have the outlook 12 object library,
    and i got the same error.
    Had a view of the reference in the object browser...
    and it all came down to namespaces.

    Try the following
    using Microsoft.Offic e.Interop.Outlo ok;

    else, expand references in the solution explorer, and check the namespace under which outlook falls (use the complete namespace)

    Comment

    • mnarewec
      New Member
      • Nov 2007
      • 22

      #3
      Originally posted by Shashi Sadasivan
      Seems somehow the example skips on how to skip all the namespaces they have.

      I have the outlook 12 object library,
      and i got the same error.
      Had a view of the reference in the object browser...
      and it all came down to namespaces.

      Try the following
      using Microsoft.Offic e.Interop.Outlo ok;

      else, expand references in the solution explorer, and check the namespace under which outlook falls (use the complete namespace)
      Yes you're correct. Right After I post this I found out when I expand the Outlook reference to see its components. Thanks anyway.

      Comment

      Working...