![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: boxes, count, form |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I have created a new form (for an appointment) in my Outlook 2003 calendar. In this form there are many textboxes. In that box must be put a name or description for that appointment. Now, I want to count automatically the number of textboxes wich are filled. This number must be put in the 'subject' field of the calendar, so i can see how many appointments there are. Is there any solution for this problem? In the dutch discussion group cames not a solution for this, so i will try it (in my best school english) on this group. Regards, Johan Nijsse The Netherlands. |
| Ads |
|
#2
|
|||
|
|||
|
Each tab in the form that was modified is in the Inspector.ModifiedFormPages
collection. If one of your pages has the name of "MyPage" (as an example) you can access it using code like this: Dim colPages As Outlook.Pages Dim oPage As MSForms.Page Dim colControls As MSForms.Controls Set colPages = item.GetInspector.ModifiedFormPages Set oPage = colPages.Item("MyPage") Set colControls = oPage.Controls You can then iterate the Controls collection of that page and check the Name property of each Control object. By default textboxes would be Textbox1, Textbox2, etc. If you've renamed the controls use your custom names to identify the textboxes and then you can check the Value or Text property of each textbox to retrieve the control's contents. See if that helps. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JMNijsse" wrote in message ... Hello, I have created a new form (for an appointment) in my Outlook 2003 calendar. In this form there are many textboxes. In that box must be put a name or description for that appointment. Now, I want to count automatically the number of textboxes wich are filled. This number must be put in the 'subject' field of the calendar, so i can see how many appointments there are. Is there any solution for this problem? In the dutch discussion group cames not a solution for this, so i will try it (in my best school english) on this group. Regards, Johan Nijsse The Netherlands. |
|
#3
|
|||
|
|||
|
This is very, very difficult for me.
Is it VBA code? I never worked with it, before. So its new for me. And I have a dutch version of Outlook. So I must translate all unknown terms and find out what it is in dutch. But in de design-mode for Forms I can make a field or a box, and set this as Value (for example). Then I can with right-click on this box choose Properties. One tab names Value. And there I can work with Formulas. But that's no option? Is the only way VBA or very difficult code? Regards, JOhan "Ken Slovak - [MVP - Outlook]" wrote: Each tab in the form that was modified is in the Inspector.ModifiedFormPages collection. If one of your pages has the name of "MyPage" (as an example) you can access it using code like this: Dim colPages As Outlook.Pages Dim oPage As MSForms.Page Dim colControls As MSForms.Controls Set colPages = item.GetInspector.ModifiedFormPages Set oPage = colPages.Item("MyPage") Set colControls = oPage.Controls You can then iterate the Controls collection of that page and check the Name property of each Control object. By default textboxes would be Textbox1, Textbox2, etc. If you've renamed the controls use your custom names to identify the textboxes and then you can check the Value or Text property of each textbox to retrieve the control's contents. See if that helps. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JMNijsse" wrote in message ... Hello, I have created a new form (for an appointment) in my Outlook 2003 calendar. In this form there are many textboxes. In that box must be put a name or description for that appointment. Now, I want to count automatically the number of textboxes wich are filled. This number must be put in the 'subject' field of the calendar, so i can see how many appointments there are. Is there any solution for this problem? In the dutch discussion group cames not a solution for this, so i will try it (in my best school english) on this group. Regards, Johan Nijsse The Netherlands. |
|
#4
|
|||
|
|||
|
That was VBA code, and the only English specific thing in it was the
imaginery name I made up for the form page. You'd just substitute your page name. The same code in VBScript (Outlook form code would look like this, complete with a Function declaration: Function CountBoxes(pageName) 'pass page name into function Dim colPages 'As Outlook.Pages Dim oPage 'As MSForms.Page Dim colControls 'As MSForms.Controls Dim oControl 'As MSForm.Control Dim boxCount 'As Long ' use Item which is intrinsic to that open form. Set colPages = Item.GetInspector.ModifiedFormPages Set oPage = colPages.Item(pageName) Set colControls = oPage.Controls boxCount = 0 For Each oControl In colControls ' compare to see if this control has "textbox" in the control.Name If InStr(1, oControl.Name, "textbox", 1) 0 Then boxCount = boxCount + 1 End If Next CountBoxes = boxCount End Function -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JMNijsse" wrote in message ... This is very, very difficult for me. Is it VBA code? I never worked with it, before. So its new for me. And I have a dutch version of Outlook. So I must translate all unknown terms and find out what it is in dutch. But in de design-mode for Forms I can make a field or a box, and set this as Value (for example). Then I can with right-click on this box choose Properties. One tab names Value. And there I can work with Formulas. But that's no option? Is the only way VBA or very difficult code? Regards, JOhan |
|
#5
|
|||
|
|||
|
Thanks, thanks.
I will try. But first I have to learn a bit of VBA or VBScript... Greetz, Johan "Ken Slovak - [MVP - Outlook]" wrote: That was VBA code, and the only English specific thing in it was the imaginery name I made up for the form page. You'd just substitute your page name. The same code in VBScript (Outlook form code would look like this, complete with a Function declaration: Function CountBoxes(pageName) 'pass page name into function Dim colPages 'As Outlook.Pages Dim oPage 'As MSForms.Page Dim colControls 'As MSForms.Controls Dim oControl 'As MSForm.Control Dim boxCount 'As Long ' use Item which is intrinsic to that open form. Set colPages = Item.GetInspector.ModifiedFormPages Set oPage = colPages.Item(pageName) Set colControls = oPage.Controls boxCount = 0 For Each oControl In colControls ' compare to see if this control has "textbox" in the control.Name If InStr(1, oControl.Name, "textbox", 1) 0 Then boxCount = boxCount + 1 End If Next CountBoxes = boxCount End Function -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "JMNijsse" wrote in message ... This is very, very difficult for me. Is it VBA code? I never worked with it, before. So its new for me. And I have a dutch version of Outlook. So I must translate all unknown terms and find out what it is in dutch. But in de design-mode for Forms I can make a field or a box, and set this as Value (for example). Then I can with right-click on this box choose Properties. One tab names Value. And there I can work with Formulas. But that's no option? Is the only way VBA or very difficult code? Regards, JOhan |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get a count of total contacts & count in a category? | Nick Chargin MBA CRS | Outlook - Using Contacts | 3 | January 17th 08 06:40 AM |
| Populating the to field based on values of multiple check boxes on the outlook form | jay.tabatabai@gmail.com | Outlook - Using Forms | 3 | September 24th 07 12:26 PM |
| Count actual work form all non compleated task. | Sprimdal | Outlook and VBA | 1 | March 27th 07 02:17 AM |
| Boxes in my addresses | Oggy | Outlook - General Queries | 3 | January 3rd 07 08:01 PM |
| List Boxes | Motaad | Outlook - Using Forms | 7 | August 9th 06 12:30 AM |