So I'm setting up my mailing list program. Everything is going and working great. It catches the message from outlook when a new message is received.
But I can't do anything with the data? The code for the message catch is
but I can't do anything with str?
for example
msgbox(str) works great! I get a pretty message box saying "whoever@whatever.com, subscribe"
BUT, if I try to do anything else with it
I get this error
Why is this happening?
Thanks for the help guys. I'll be a vb.net programmer someday...
Nick
But I can't do anything with the data? The code for the message catch is
VB.NET:
Dim OutlookNS As Outlook.NameSpace
OutlookNS = outlookApp.GetNamespace("MAPI")
Dim Inbox As Outlook.MAPIFolder
Inbox = OutlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
Dim NewMail As Outlook.MailItem
NewMail = OutlookNS.GetItemFromID(EntryIDCollection, Inbox.StoreID)
Dim str As String = NewMail.SenderEmailAddress & "," & NewMail.Subject
for example
msgbox(str) works great! I get a pretty message box saying "whoever@whatever.com, subscribe"
BUT, if I try to do anything else with it
VB.NET:
textbox1.text = str
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Why is this happening?
Thanks for the help guys. I'll be a vb.net programmer someday...
Nick