excel object in Custom Outlook form

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
 
E

Eric Legault [MVP - Outlook]

Please post to microsoft.public.excel.programming; you're more likely to get
an answer there.
 
D

dh

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
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top