Consulting

Results 1 to 3 of 3

Thread: Solved: Outlook forms and validation

  1. #1
    VBAX Regular
    Joined
    Apr 2005
    Posts
    17
    Location

    Solved: Outlook forms and validation

    Hi all



    I am working on a small outlook form, and I would like Outlook to validate if a specific textbox are empty or not when the user presses on the Send button.



    I tried to use the validation under properties for the textbox, but it doesn?t set focus on the textbox that is empty, it just says that something is missing.



    I like code to do something like this when the ?Item_Send? is used



    if textbox1.value="" then
    msgbox bla.
    textbox1.setfocus
    end if




    I am totally new in creating customs form with VBS, so any help is fine

    Regards Rico

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Rico

    Have you tried that code?

    It's basically correct and should go in the send button's click event.

    If you double click the send button then you should get the click event.

    By the way what validation for the textbox do you mean?

  3. #3
    VBAX Regular
    Joined
    Apr 2005
    Posts
    17
    Location
    Hi Norie

    I found a solution which look like this

    [VBA]
    Function Item_Write()

    Set objPage = Item.GetInspector.ModifiedFormPages("Message")
    Set objControl = objPage.Controls("MyTextBoxs")

    If objPage.Controls("MyTextBoxs") = "" Then
    Item_Write = False
    MsgBox "Please insert text in MyTextbox."
    ObjControl.SetFocus
    End If

    End Function
    [/VBA]

    Sorry If my english is a bit rusty :-)
    With validation I meant, when you rigth click on a textboxs and choose Properties (Edit mode for the form) here you can set some validation properties.

    Regards Rico

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •