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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
I am using Office XP Professional, outlook 2002.
I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
Ads |
#2
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
The article at http://www.outlookcode.com/article.aspx?id=69 has an example
of the code required. Look under the "Handling data" section. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#3
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
Thanks so much Sue.. But i still have a problem. I copies the code you
indicate below but when i open the form i get an error message of object required: "oPage" line no:5 and it don't work for me? Any thoughts. To be honest i do not know how to write one of these codes, so I really am at loss. "Sue Mosher [MVP-Outlook]" wrote: The article at http://www.outlookcode.com/article.aspx?id=69 has an example of the code required. Look under the "Handling data" section. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#4
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
Did you modify the code so that the page and control names in the code match
the corresponding names on your form? The article at http://www.outlookcode.com/article.aspx?ID=38 explains the syntax for referring to custom form pages and controls. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: Thanks so much Sue.. But i still have a problem. I copies the code you indicate below but when i open the form i get an error message of object required: "oPage" line no:5 and it don't work for me? Any thoughts. To be honest i do not know how to write one of these codes, so I really am at loss. "Sue Mosher [MVP-Outlook]" wrote: The article at http://www.outlookcode.com/article.aspx?id=69 has an example of the code required. Look under the "Handling data" section. "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#5
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
I did modify the code so that the page (Tab2) and control (Spreadsheet1)
matched up to the names on the on the form. But when I open my newly created contact form to enter information I still get a - Object Required: "oPage" Line No:5 message. And it will not retain the information that I have entered on the spread sheet. Any Ideas why? "Sue Mosher [MVP-Outlook]" wrote: Did you modify the code so that the page and control names in the code match the corresponding names on your form? The article at http://www.outlookcode.com/article.aspx?ID=38 explains the syntax for referring to custom form pages and controls. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: Thanks so much Sue.. But i still have a problem. I copies the code you indicate below but when i open the form i get an error message of object required: "oPage" line no:5 and it don't work for me? Any thoughts. To be honest i do not know how to write one of these codes, so I really am at loss. "Sue Mosher [MVP-Outlook]" wrote: The article at http://www.outlookcode.com/article.aspx?id=69 has an example of the code required. Look under the "Handling data" section. "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#6
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
You'll need to post some code, at least that for line 5.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: I did modify the code so that the page (Tab2) and control (Spreadsheet1) matched up to the names on the on the form. But when I open my newly created contact form to enter information I still get a - Object Required: "oPage" Line No:5 message. And it will not retain the information that I have entered on the spread sheet. "Sue Mosher [MVP-Outlook]" wrote: Did you modify the code so that the page and control names in the code match the corresponding names on your form? The article at http://www.outlookcode.com/article.aspx?ID=38 explains the syntax for referring to custom form pages and controls. "IT Girl" wrote: Thanks so much Sue.. But i still have a problem. I copies the code you indicate below but when i open the form i get an error message of object required: "oPage" line no:5 and it don't work for me? Any thoughts. To be honest i do not know how to write one of these codes, so I really am at loss. "Sue Mosher [MVP-Outlook]" wrote: The article at http://www.outlookcode.com/article.aspx?id=69 has an example of the code required. Look under the "Handling data" section. "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#7
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
Hi Sue... Thanks for the help by the way.. O.k. So this is the code.
Dim XLSheet Function Item_Open() Set XLSheet = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") XLSheet.HTMLData = Item.Body Item.Subject = Trim(Item.Subject & " ") 'Dirty the form End Function Function Item_Write() Item.Body("XLSheet") = XLSheet.HTMLData End Function I rechecked the Contral and page name just to make sure i have them right and in the right places. "Sue Mosher [MVP-Outlook]" wrote: You'll need to post some code, at least that for line 5. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: I did modify the code so that the page (Tab2) and control (Spreadsheet1) matched up to the names on the on the form. But when I open my newly created contact form to enter information I still get a - Object Required: "oPage" Line No:5 message. And it will not retain the information that I have entered on the spread sheet. "Sue Mosher [MVP-Outlook]" wrote: Did you modify the code so that the page and control names in the code match the corresponding names on your form? The article at http://www.outlookcode.com/article.aspx?ID=38 explains the syntax for referring to custom form pages and controls. "IT Girl" wrote: Thanks so much Sue.. But i still have a problem. I copies the code you indicate below but when i open the form i get an error message of object required: "oPage" line no:5 and it don't work for me? Any thoughts. To be honest i do not know how to write one of these codes, so I really am at loss. "Sue Mosher [MVP-Outlook]" wrote: The article at http://www.outlookcode.com/article.aspx?id=69 has an example of the code required. Look under the "Handling data" section. "IT Girl" wrote: I am using Office XP Professional, outlook 2002. I am desiging a custom form, using the contact templete. In this templete I have bound an XLSpreedsheet to one of the pages on my custom. I have added the spreadsheet control to the form but I am having a problem with the data retention in the spreadsheet after the form is published. Sue Moshure was a fantastic help. She advised me that I need a code in the form events that will provide a way to save the data and restore it when the user opens or reopens the form. Creating this code is now a bigger challenge for me then getting the spreadsheet imbeded in my form to begin with. Can some tell me or have a code that will alow the form user to enter data in the spreadsheet that is imbedded in the contacts form, save this information, then reopen this form and edit this data. |
#8
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
If you look at these two statements and compare with the source code at
http://www.outlookcode.com/article.aspx?id=69, you should see your mistake: Set XLSheet = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") You have two statements instantiating an object variable named XLSheet, when what you need is one statement to instantiate a variable named oPage, then a second statement to instantiate XLSheet. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: Hi Sue... Thanks for the help by the way.. O.k. So this is the code. Dim XLSheet Function Item_Open() Set XLSheet = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") XLSheet.HTMLData = Item.Body Item.Subject = Trim(Item.Subject & " ") 'Dirty the form End Function Function Item_Write() Item.Body("XLSheet") = XLSheet.HTMLData End Function I rechecked the Contral and page name just to make sure i have them right and in the right places. |
#9
|
|||
|
|||
HTMLData property for XLSpreadsheet in contracts form
I have made the corrections you noted. But I am still getiing the the same
script error when I open the contact and then when I update the information, save and close I get another error of - Object required: 'XLSheet' Line No. 11. Did I miss something Sue? Here's the code again. Dim XLSheet Function Item_Open() Set oPage = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") XLSheet.HTMLData = Item.Body Item.Subject = Trim(Item.Subject & " ") 'Dirty the form End Function Function Item_Write() Item.Body("XLSheet") = XLSheet.HTMLData End Function If I can't get this to work, I have an alternate solution I would like to try. But I have encountered a problem with that one as well. For my alternate solution I have used a button control on a tab in my contact form to launch an XL Sheet. This would work as well, just not what I was hoping to do for this purpose. The problem with this option is the command code launches the pre-set XL-sheet from the D drive of my computer. This contact form design is to be used on the public drive and I would need the code to instruct the XL-Sheet to launch form the public drive so all who have access can get the same information. Is this possible? If it is easier to get working then I would go this route and forget my original design. I have the code that launchs form the D-drive for this alternate option if it helps? Can it be cchanged to launch an ex-sheet form the public drive? Sub GroupINFO_Click Set objExcelApp = Item.Application.CreateObject("Excel.Application") objExcelApp.Workbooks.Open("GroupINFO.xls") Set objExcelBook = objExcelApp.ActiveWorkbook Set objExcelSheets = objExcelBook.Worksheets Set objExcelSheet = objExcelBook.Sheets(1) objExcelSheet.Activate objExcelApp.Application.Visible = True End Sub - IT Girl "Sue Mosher [MVP-Outlook]" wrote: If you look at these two statements and compare with the source code at http://www.outlookcode.com/article.aspx?id=69, you should see your mistake: Set XLSheet = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") You have two statements instantiating an object variable named XLSheet, when what you need is one statement to instantiate a variable named oPage, then a second statement to instantiate XLSheet. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "IT Girl" wrote: Hi Sue... Thanks for the help by the way.. O.k. So this is the code. Dim XLSheet Function Item_Open() Set XLSheet = Item.GetInspector.ModifiedFormPages("Tab2") Set XLSheet = oPage.Controls("Spreadsheet1") XLSheet.HTMLData = Item.Body Item.Subject = Trim(Item.Subject & " ") 'Dirty the form End Function Function Item_Write() Item.Body("XLSheet") = XLSheet.HTMLData End Function I rechecked the Contral and page name just to make sure i have them right and in the right places. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automatic add to contracts on reply | Linda | Outlook - Using Contacts | 1 | September 10th 08 11:44 PM |
UNDO Automatic add to contracts on reply | Rich | Outlook - Using Contacts | 3 | August 29th 08 08:59 PM |
Mail Merge for fax letters and contracts | shooter | Outlook - General Queries | 5 | November 29th 07 08:06 PM |
Calendar Contracts | Adrian | Outlook - Calandaring | 2 | June 24th 07 09:29 PM |
"Resize with form" property on custom controls | Vaughan | Outlook - Using Forms | 2 | February 6th 06 09:03 PM |