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.