Hi,
I've just installed Visual Studio 2008 on my PC and I'm attempting to write an Outlook addin. I have a good understanding of vbscript and have adapted some VBA examples before but there are some fundamental questions which are preventing me from moving forwards.
My code at the moment is:
If I want to check my inbox for new emails arriving does the code to do that go where I've put my comments or am I in the wrong place? Sorry if that is a basic question most of the tutorials assume that the user has more than zero knowledge!
Next - I've been looking at an example here:
The first line is:
What does this line actually mean? Is it declaring an object myOlApp? If so what does WithEvents get added for?
Next we have
This part I understand!
Then we have
This is going to sound a very stupid question but if you call a sub xxx_NewMail() does that mean run the code in that sub when a new mail arrives or can you call it anything you want and the code that checks for new mail is contained within the sub?
Thanks - I think if I've got these basics right then I'll be at least able to move forward in small steps!
Ed
I've just installed Visual Studio 2008 on my PC and I'm attempting to write an Outlook addin. I have a good understanding of vbscript and have adapted some VBA examples before but there are some fundamental questions which are preventing me from moving forwards.
My code at the moment is:
Code:
Public Class ThisAddIn
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
End Sub
'My new code to go here?
'End of my code
End Class
If I want to check my inbox for new emails arriving does the code to do that go where I've put my comments or am I in the wrong place? Sorry if that is a basic question most of the tutorials assume that the user has more than zero knowledge!
Next - I've been looking at an example here:
The first line is:
Code:
Public WithEvents myOlApp As Outlook.Application
What does this line actually mean? Is it declaring an object myOlApp? If so what does WithEvents get added for?
Next we have
Code:
Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.Application")
End Sub
This part I understand!
Then we have
Code:
Private Sub myOlApp_NewMail()
End Sub
This is going to sound a very stupid question but if you call a sub xxx_NewMail() does that mean run the code in that sub when a new mail arrives or can you call it anything you want and the code that checks for new mail is contained within the sub?
Thanks - I think if I've got these basics right then I'll be at least able to move forward in small steps!
Ed