|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
custom buttons and vbaHello.
I have done a lot of vba programming in excel. I'm trying to apply what I know from xl to outlook and am really stumped. I added a command button to the contact form. In excel, I could just double click it and the vba environment would open with the command button click event already started. Not so in Outlook. What I am trying to do, is add a command button to the contact form and write vba code that would pass data in some of the contact form fields to another application using ADO. So the question is, how to "link" vba code to the custom control and how to reference fields on the contact form. Any help would really be appreciated! Happy New Year, George You don't, at least not directly. Custom Outlook forms run VBScript, not
VBA. For item-level events, you can use the Script | Event Handler command to insert the shell for an event procedure. For Click event handlers, you need to write your own: Sub CommandButton1_Click() MsgBox "You clicked CommandButton1" End Sub Your VBScript form code can call a Public VBA procedure located in the built-in ThisOutlookSession module as Application.my_procedure_name. See http://www.outlookcode.com/d/propsyntax.htm for basics on Outlook property syntax. -- Show quoteHide quoteSue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "GeorgeFD29" <GeorgeF***@discussions.microsoft.com> wrote in message news:4C6E1096-320B-4D05-A368-48B3D3AA4E6B@microsoft.com... > Hello. > > I have done a lot of vba programming in excel. I'm trying to apply what I > know from xl to outlook and am really stumped. I added a command button > to > the contact form. In excel, I could just double click it and the vba > environment would open with the command button click event already > started. > Not so in Outlook. > > What I am trying to do, is add a command button to the contact form and > write vba code that would pass data in some of the contact form fields to > another application using ADO. So the question is, how to "link" vba code > to > the custom control and how to reference fields on the contact form. > > Any help would really be appreciated! > > Happy New Year, > George Outlook forms do not use VBA, they use VBScript and the code is embedded in
the form definition. It becomes accessible to users after you publish the custom form. In the form code you would have a procedure something like this for a button named cmdClicker: Sub CmdClicker_Click() See http://www.outlookcode.com/d/formcontrols.htm for lots of information to get you started programming Outlook forms. -- Show quoteHide quoteKen Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "GeorgeFD29" <GeorgeF***@discussions.microsoft.com> wrote in message news:4C6E1096-320B-4D05-A368-48B3D3AA4E6B@microsoft.com... > Hello. > > I have done a lot of vba programming in excel. I'm trying to apply what I > know from xl to outlook and am really stumped. I added a command button > to > the contact form. In excel, I could just double click it and the vba > environment would open with the command button click event already > started. > Not so in Outlook. > > What I am trying to do, is add a command button to the contact form and > write vba code that would pass data in some of the contact form fields to > another application using ADO. So the question is, how to "link" vba code > to > the custom control and how to reference fields on the contact form. > > Any help would really be appreciated! > > Happy New Year, > George
Other interesting topics
Attn Sue - Outlook automation not working in windows service
Read_links_in_Mails? Sending emails with MAPI Inspector CommandBarButton with Word as Mail Late binding to Outlook via VBA Converting Outlook2003 .pst to Outlook2002 My add-in never gets loaded Return the date and hours currently selected in the calender Capture the subject line of an e-mail Max Limit for Values in List Boxes and Combo Boxes in Outlook forms |
|||||||||||||||||||||||