Change procedure from WPTools3 to WPTools5

  • Hi

    I have this code (WPTools 3) and I'm trying to change for the version 5.
    Can somebody help me?

    Thanks.

    • Offizieller Beitrag
    Code
    // locate a certain TWPObject     WPRichText1.TextObjects.Selected := Obj;     // and move it (using the reference TWPTextObj)     with WPRichText1.TextObjects.SelectedObj do     begin        PositionMode := wpotPar;        RelX := relX;        RelY := relY;     end;

    alternatively you can also the list ObjList[0..ObjCount-1]:

    Code
    for i:=0 to WPRichText1.TextObjects.ObjCount-1 do
           if WPRichText1.TextObjects.ObjList[i].ObjRef=anObj then
           begin
            WPRichText1.TextObjects.ObjList[i].PositionMode := wpotPar;
            WPRichText1.TextObjects.ObjList[i].RelX := 5000;
            WPRichText1.TextObjects.ObjList[i].RelY := 5000;
           end;

    Please note that the list is built up by using the function ObjCount. So it is save to use it with a (pascal) "for" loop, but better avoid a while loop. In C++ you must save ObjCount to a variable first.

    Regards,

    Julian