Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE2 and Fit To 1 Page

Status
Not open for further replies.

krindler

Programmer
Jul 16, 2002
39
US
Hello...

I have the following code when trying to fit the data in the report to 1 page, but it is not reading the 'FitToPagesWide' and 'FitToPagesTall'. Can anyone think of a reason this is not working?

hPageSet := OLE2.GET_OBJ_PROPERTY (worksheet, 'pagesetup'); OLE2.SET_PROPERTY ( hPageSet, 'orientation', 2 );
OLE2.SET_PROPERTY ( hPageSet, 'CenterHeader', 'Header'); OLE2.SET_PROPERTY ( hPageSet, 'CenterHorizontally', True )
OLE2.SET_PROPERTY ( hPageSet, 'FitToPagesWide', 1 );
OLE2.SET_PROPERTY ( hPageSet, 'FitToPagesTall', 1 );
OLE2.RELEASE_OBJ ( hPageSet );

Any help you could give me would be much appreciated.

Thanks In Advance!!
 
This probably won't make any difference but, you might want to explicitly set the Zoom property to False, since the FitToPages property won't work when the Zoom property is true.

My other suggestion would be to try changing the orientation to portrait and see what happens.
 
Thanks You...

Explicitly setting the Zoom property to False fixed the problem!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top