Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Access Outlook via VB.Net

Access Outlook via VB.Net

Scheduled Pinned Locked Moved Visual Basic
csharptutorial
7 Posts 3 Posters 56 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marvin Wapnitsky
    wrote on last edited by
    #1

    Years ago, I wrote a VB6 App to add creation date to certain Outlook items. Now, I don't even know how to access Outlook folders via VB.NET. A complete code sample to run through the Outlook folders would be much appreciated. Thanks. Marvin

    L M 2 Replies Last reply
    0
    • M Marvin Wapnitsky

      Years ago, I wrote a VB6 App to add creation date to certain Outlook items. Now, I don't even know how to access Outlook folders via VB.NET. A complete code sample to run through the Outlook folders would be much appreciated. Thanks. Marvin

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See Automating Outlook from a Visual Basic Application | Microsoft Learn[^]

      M 1 Reply Last reply
      0
      • L Lost User

        See Automating Outlook from a Visual Basic Application | Microsoft Learn[^]

        M Offline
        M Offline
        Marvin Wapnitsky
        wrote on last edited by
        #3

        Thank you for your response, but it does not satisfy my issue. I want to create a VB.Net app, not a VBA routine. I have tried the code snippets you have suggested, but continue to get errors when trying to run it in Visual Studio. Any further suggetions would be appreciated. Marvin

        L 1 Reply Last reply
        0
        • M Marvin Wapnitsky

          Thank you for your response, but it does not satisfy my issue. I want to create a VB.Net app, not a VBA routine. I have tried the code snippets you have suggested, but continue to get errors when trying to run it in Visual Studio. Any further suggetions would be appreciated. Marvin

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I think maybe the title of that page was misleading. However, there are many examples returned by the following Google search: vb net interop outlook example - Google Search[^]

          M 1 Reply Last reply
          0
          • L Lost User

            I think maybe the title of that page was misleading. However, there are many examples returned by the following Google search: vb net interop outlook example - Google Search[^]

            M Offline
            M Offline
            Marvin Wapnitsky
            wrote on last edited by
            #5

            Again, thanks for the reply. I see no reference to where the code should be copied. I want to create a Windows Form App with VB.net. When I place the code into the "View Code" area, I get multiple errors. I guess I need additional help. Marvin

            L 1 Reply Last reply
            0
            • M Marvin Wapnitsky

              Again, thanks for the reply. I see no reference to where the code should be copied. I want to create a Windows Form App with VB.net. When I place the code into the "View Code" area, I get multiple errors. I guess I need additional help. Marvin

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I have no idea what you are doing or what errors you are seeing, so these suggestions may, or may not, help. If I assume you are using Visual Studio 2022, you first need to create a Windows Forms application using the VB.NET and .NET Framework workload. You should then see the names of your project files in the Solution Explore window. Open the Form1.vb file (you may need to right click on the name and select "View Code"), which should give you an editor view of the generated code. You should now be able to see where the different parts of the code can be inserted.

              1 Reply Last reply
              0
              • M Marvin Wapnitsky

                Years ago, I wrote a VB6 App to add creation date to certain Outlook items. Now, I don't even know how to access Outlook folders via VB.NET. A complete code sample to run through the Outlook folders would be much appreciated. Thanks. Marvin

                M Offline
                M Offline
                Member_16228941
                wrote on last edited by
                #7

                You could use this code:

                Imports Microsoft.office.Interop.Outlook
                Public class CLASS_NAME
                Public App As OutlookApplication
                Public Sub new()
                App = new ( App.getType())
                End Sub
                End Class
                ' also consider using createObject("outlook.Application")'

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups