Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2004

Tip: Looking for answers? Try searching our database.

Excel on custom outlook form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michelle Key - 08 Jul 2004 15:35 GMT
I have been struggling with this for far too long.  I'm having a problem
with an Excel Spreadsheet control on a custom OL '03 contact form. I
added the spreadsheet on the second page of the form. My problem is that
it appears that I can either display the spreadsheet as I've formatted
it, complete with column headers, but the users can't enter data, OR I
can allow users to enter and save data with the VBScript copied and
modified from Sue Mosher's site...

Dim XLSheet

Function Item_Open()
   Set oPage = Item.GetInspector.ModifiedFormPages("Notes")
   Set XLSheet = oPage.Controls("Spreadsheet1")
   XLSheet.HTMLData = Item.BillingInformation
   Item.Subject = Item.Subject 'Dirty the form
End Function

Function Item_Write()
   Item.BillingInformation = XLSheet.HTMLData
End Function

but not both. I either get a blank spreadsheet without formatting or
headers that I can type into and save, or I get an error message that
states that the spreadsheet is locked. When I delete the code entirely,
I can see the spreadsheet as formatted, but that doesn't allow the
saving of data. I tried setting the protection of the spreadsheet AFTER
opening it up with code, but that didn't work either. I'm better at VBA
than VBS and I know I'm missing something here. What I want is for the
users to see a spreadsheet with three columns, the first row with
headers that is protected from change, and they can enter new data into
the spreadsheet and save the info when they save the contact info.

I tried to copy info in from another spreadsheet to an existing contact
that was already based on my custom form, but when I saved and closed
the form and opened it back up, the info I had copied and pasted was
gone.

I know it  can be done - I even tried copying the Outlook Expense Report
example but I couldn't "design" it.  (I noticed it was a different
class:  IPM.DOCUMENT.EXCEL.SHEET.8, mine is IPM.CONTACT...and the name
of my form)

Could it have anything to do with HTML vs. XML?

At wits' end...
Signature

Michelle Key

Sue Mosher [MVP-Outlook] - 04 Aug 2004 14:20 GMT
If you want protection, you'd need to add that after the XLSheet.HTMLData =
Item.BillingInformation statement, something like:

   XLSheet.Rows(1).Locked = True
   XLSheet.Protect

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> I have been struggling with this for far too long.  I'm having a problem
> with an Excel Spreadsheet control on a custom OL '03 contact form. I
[quoted text clipped - 41 lines]
>
> At wits' end...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.