|
-
Jun 24th, 2010, 06:29 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Outlook Programming Simple help required
Hey,
OK a really basic question but one which has had me baffled all morning.
I have created an Outlook Task Form.
Now all I want to happen is display a message box from VBA either when the form loads or when the Form is sent.
I just cannot get the VBA code to run.
I have currently put the code in the project ThisOutlookSession. Am I missing something simple do I need to somewhere wire the VBA up to the form?
Code:
Private Sub Application_ItemLoad(ByVal Item As Object)
MsgBox "item load"
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
MsgBox "item send"
End Sub
Or on an even simpler example if I put a button on a form where is its onlick event as there appears to be no property for this?
I have a commandbutton1 on the form, then within module 1 I have the code
Sub CommandButton1_Click()
MsgBox "button click"
End Sub
but still when the form is run and the button is clicked nothing happens.
Last edited by FishGuy; Jun 24th, 2010 at 06:39 AM.
-
Jun 24th, 2010, 06:47 AM
#2
Re: Outlook Programming Simple help required
I have a commandbutton1 on the form, then within module 1 I have the code
the command button click event must on the form codepage, not in a module
ideally select the event from the dropdown boxes at the top of the userform codepage
I have currently put the code in the project ThisOutlookSession.
i don't have outlook, but try right clicking on the commandbutton, see if there is assign macro or other similar option
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jun 24th, 2010, 07:36 AM
#3
Thread Starter
Frenzied Member
Re: Outlook Programming Simple help required
the formcode page doesnt appear in the project and there doesnt appear to be any assign macro option when right clicking the button.
-
Jun 24th, 2010, 09:22 AM
#4
Thread Starter
Frenzied Member
Re: [RESOLVED] Outlook Programming Simple help required
OK om using the script editor now instead of the VBA which is working fine, not a very nice dev environment though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|