Results 1 to 4 of 4

Thread: [RESOLVED] Outlook Programming Simple help required

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  3. #3

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    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.

  4. #4

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    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
  •  



Click Here to Expand Forum to Full Width