excel object in Custom Outlook form

  • Thread starter Thread starter dh
  • Start date Start date
D

dh

I have a custom Outlook form, with an Excel spreadsheet object. I want to
format the cell width and I can't seem to get the format correct
This is the code that I tried and the syntax seems incorrect

Range("A1:D10").Select
Columns("A:A").ColumnWidth = 14

Columns("B:B").ColumnWidth = 12.57

Columns("C:C").ColumnWidth = 14

Columns("D:D").ColumnWidth = 14.86

Any ideas?

Thanks!

DH
 
Please post to microsoft.public.excel.programming; you're more likely to get
an answer there.
 
I used your example from your website

m XLSheet

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

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

DH
 
XLSheet is the spreadsheet object. You need to use that as a parent for your
range:

XLSheet.Range("A1:D10").Select

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top