Assigning different margins does nothing

  • I am creating a new blank document, and in the initialisation code, I use a very small margin just to know if it is working.

    Those margins are not reflected in the dotted lines representing the usable area.

    Trying to debug this, I see that the UpdatePageInfo procedure in the WPRTEDefs module is void, and does not contain any code.

    I am using version 7.07, and if I look to my previous version (7.03) there is some code in that function.

    So, my questions are:

    1.) How a simple matter like configuring margins to a new document is properly done.

    2.) As UpdatePageInfo has no code, is this a bug, or this function will be deprecated in the future.

    • Offizieller Beitrag

    10 twips is a rather small value - about 0,2 mm.

    But in my tests the code

    WPRichText1.Header.LeftMargin := 10;
    WPRichText1.Header.RightMargin := 10;
    WPRichText1.Header.TopMargin := 10;
    WPRichText1.Header.BottomMargin := 10;

    will change the margins immediately to almost nothing, the same what

    WPRichText1.Header.SetPageWH(0,0,10,10,10,10);

    does. But maybe you want to set the margin in Pixels? Then use

    WPRichText1.Header.SetPageWHPix(0,0,10,10,10,10);