PDA

View Full Version : A question about margins


Unregistered
October 29, 2002, 00:05:58
Hi there.

I'm loading rtf documents.

If the font is set to Arial in the rtf document, Arial is loaded as the font. If I set the font size to 20, the font is loaded at 20 pt.

However, if the margins are set to 2880 (2 inches), the margins do not load as 2880. They're loaded as the current value of the PageMarginL property.

How do I correctly load the margin information storted in the rtf file?

Am I correct that LoadSaveAttribute only works with the TX format, not with RTF format?

Thanks,

Elizabeth


This message was originally posted by Elizabeth in the old TX Text Control Support Forum.

Meik Dankleff
October 29, 2002, 15:08:02
The LoadSaveAttribute property has to be used here. It does work with RTF format as well as with other formats that are able to store the page settings in the document. Here is a code snippet from the VB MDI demo that does the job:

If .LoadSaveAttribute(txDocWidth) > 0 Then .PageWidth = .LoadSaveAttribute(txDocWidth)
If .LoadSaveAttribute(txDocHeight) > 0 Then .PageHeight = .LoadSaveAttribute(txDocHeight)
If .LoadSaveAttribute(txDocLeftMargin) > 0 Then .PageMarginL = .LoadSaveAttribute(txDocLeftMargin)
If .LoadSaveAttribute(txDocTopMargin) > 0 Then .PageMarginT = .LoadSaveAttribute(txDocTopMargin)
If .LoadSaveAttribute(txDocRightMargin) > 0 Then .PageMarginR = .LoadSaveAttribute(txDocRightMargin)
If .LoadSaveAttribute(txDocBottomMargin) > 0 Then .PageMarginB = .LoadSaveAttribute(txDocBottomMargin)

Use this code >after< the document has been loaded.


This message was originally posted by Meik Dankleff in the old TX Text Control Support Forum.

Unregistered
October 29, 2002, 17:05:17
Marvelous! Thanks so much.

Elizabeth


This message was originally posted by Elizabeth in the old TX Text Control Support Forum.