locked
OUTLOOK CUSTOM FORM WITH CUSTOM FIELDS RRS feed

  • Question

  • Hello,

    I want to create a custom Message form with 3 added fields(combo boxes) PIStatus, PINumber and Customer Name that would save the info entered into Access database like seen on the picture below. Would that be possible to do and how? My main problem is that I don't know how to access the combo boxes through script. Can someone help?

    Monday, September 5, 2011 9:52 AM

Answers

  • You can access controls via the Controls collection on each modified page, such as:

    Set oCntl = oPage("P.2").Controls("TextBox1")

    See here for more details:

    http://outlookcode.com/article.aspx?ID=32

    But if your controls are bound to a custom field, it's better to read/write to the fields themselves using Item.UserProperties("MyFieldName").Value.


    Eric Legault
    MVP (Outlook)
    About me...
    • Marked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    Tuesday, September 6, 2011 2:21 PM
  • You put the code in the Script Editor for the form.  The VBA editor is a different beast entirely, genrally used for macros that don't work with custom forms (although they can).

    If you're still having problems with the code in the Script Editor, please post your full code.  Also, if this is your first custom form I strongly encourage you to read the beginner's resources available on OutlookCode.com.


    Eric Legault
    MVP (Outlook)
    About me...
    • Marked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    Thursday, September 8, 2011 2:34 PM

All replies

  • You can access controls via the Controls collection on each modified page, such as:

    Set oCntl = oPage("P.2").Controls("TextBox1")

    See here for more details:

    http://outlookcode.com/article.aspx?ID=32

    But if your controls are bound to a custom field, it's better to read/write to the fields themselves using Item.UserProperties("MyFieldName").Value.


    Eric Legault
    MVP (Outlook)
    About me...
    • Marked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    Tuesday, September 6, 2011 2:21 PM
  • Hello Eric, Where exactly do I put this code? Inside script window, inside Outlook session VB macro or where? Still it complains that the object properties are not accessible from where the code is located, no matter where I put the code.
    • Marked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    • Unmarked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    Thursday, September 8, 2011 5:40 AM
  • You put the code in the Script Editor for the form.  The VBA editor is a different beast entirely, genrally used for macros that don't work with custom forms (although they can).

    If you're still having problems with the code in the Script Editor, please post your full code.  Also, if this is your first custom form I strongly encourage you to read the beginner's resources available on OutlookCode.com.


    Eric Legault
    MVP (Outlook)
    About me...
    • Marked as answer by 许阳(无锡) Thursday, September 15, 2011 12:51 AM
    Thursday, September 8, 2011 2:34 PM