J
JoelH
This is really weird...
I'm using Visual Basic 2005 Express
I have a form - Form1 - with a control called txtStatusBox
I have a module attached to the solution for storing some other code.
This links to an Outlook MAPI folder (variable ContItems), that waits
for new items to arrive.
When a new message is delivered, the event is fired.
However, when it tries to change the text in a textbox on Form1, the
box remains unchanged:
Private Sub ConItems_ItemAdd(ByVal Item As Object) Handles
ConItems.ItemAdd
MyForm.txtStatusBox.Text="text has changed"
End Sub
I do know that the event fires because if i put a breakpoint on the
line, it breaks when a message arrives.
If I call another sub that lies within the same module, such as
Public Sub ChangeTextOnForm()
MyForm.txtStatusBox.Text="text has changed"
End Sub
then it DOES work. So, both subs are in the same module, and have the
same code, and neither reports an error. But for some reason, the code
does not work for the even procudure.
If I try to call the first sub from within the second, then it still
doesn't work. It's like the event code is running in a lower security
context than other code in the module.
Can anyone explain this please? it's driving me nuts!
thanks
joel
I'm using Visual Basic 2005 Express
I have a form - Form1 - with a control called txtStatusBox
I have a module attached to the solution for storing some other code.
This links to an Outlook MAPI folder (variable ContItems), that waits
for new items to arrive.
When a new message is delivered, the event is fired.
However, when it tries to change the text in a textbox on Form1, the
box remains unchanged:
Private Sub ConItems_ItemAdd(ByVal Item As Object) Handles
ConItems.ItemAdd
MyForm.txtStatusBox.Text="text has changed"
End Sub
I do know that the event fires because if i put a breakpoint on the
line, it breaks when a message arrives.
If I call another sub that lies within the same module, such as
Public Sub ChangeTextOnForm()
MyForm.txtStatusBox.Text="text has changed"
End Sub
then it DOES work. So, both subs are in the same module, and have the
same code, and neither reports an error. But for some reason, the code
does not work for the even procudure.
If I try to call the first sub from within the second, then it still
doesn't work. It's like the event code is running in a lower security
context than other code in the module.
Can anyone explain this please? it's driving me nuts!
thanks
joel