View Single Post
  #8  
Old October 20th 08, 08:54 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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.


Ads