Access Outlook via VB.Net
-
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
-
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
-
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
-
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
-
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[^]
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
-
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
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.
-
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
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")'