Zum Inhalt springen

Empfohlene Beiträge

Geschrieben

Hi,

ich habe über RAD 2009 ein Programm erstellt das per Exportfunktion ein Word-Dokument über OLE generiert. Dazu soll in der Kopfzeile eine Textbox integriert werden, in der das Thema steht. Ich habe alles erstellt und unter Office 2010 funktioniert das alles fehlerfrei. Nur unter Office 2003 ist die Textbox nicht an der Stelle positioniert wie unter Office 2010. Ich habe auch schon versucht, wenn es Office 2003 ist, die Textbox einfach um 20-30 Pixel nach oben zu schieben aber auch das funktioniert nicht. Die Textbox bleibt immer an der gleichen Position. Per Mausaktion kann ich sie aber problemlos an die richtig Stelle verschieben.

Hier mein Code:

Procedure InsertWordTextBox(Const AWordApplication : TWordApplication; Const ALeft, ATop, AWidth, AHeight : Double);

Begin

  AWordApplication.Selection.HeaderFooter.Shapes.AddTextbox(msoTextOrientationHorizontal, ALeft, ATop, AWidth, AHeight, EmptyParam).Select(EmptyParam);

  AWordApplication.Selection.ShapeRange.TextFrame.TextRange.Select;

  AWordApplication.Selection.Collapse(EmptyParam);

  AWordApplication.Selection.ShapeRange.Fill.Visible := msoFalse;

  AWordApplication.Selection.ShapeRange.Line.Visible := msoFalse;

  AWordApplication.Selection.ShapeRange.Line.Weight := 0.75;

  AWordApplication.Selection.ShapeRange.Line.DashStyle := msoLineSolid;

  AWordApplication.Selection.ShapeRange.Line.Style := msoLineSingle;

  AWordApplication.Selection.ShapeRange.Line.Transparency := 0;

  AWordApplication.Selection.ShapeRange.Line.Visible := msoFalse;

  AWordApplication.Selection.ShapeRange.LockAspectRatio := msoFalse;

  AWordApplication.Selection.ShapeRange.TextFrame.MarginLeft := 0;

  AWordApplication.Selection.ShapeRange.TextFrame.MarginRight := 0;

  AWordApplication.Selection.ShapeRange.TextFrame.MarginTop := 0;

  AWordApplication.Selection.ShapeRange.TextFrame.MarginBottom := 0;

  AWordApplication.Selection.ShapeRange.RelativeHorizontalPosition := wdRelativeHorizontalPositionPage;

  AWordApplication.Selection.ShapeRange.RelativeVerticalPosition := wdRelativeVerticalPositionPage;

  AWordApplication.Selection.ShapeRange.Left := ALeft;

  AWordApplication.Selection.ShapeRange.Top := ATop;

  AWordApplication.Selection.ShapeRange.WrapFormat.Side := wdWrapBoth;

  AWordApplication.Selection.ShapeRange.WrapFormat.DistanceTop := AWordApplication.CentimetersToPoints(0);

  AWordApplication.Selection.ShapeRange.WrapFormat.DistanceBottom := AWordApplication.CentimetersToPoints(0);

  AWordApplication.Selection.ShapeRange.WrapFormat.DistanceLeft := AWordApplication.CentimetersToPoints(0.32);

  AWordApplication.Selection.ShapeRange.WrapFormat.DistanceRight := AWordApplication.CentimetersToPoints(0.32);

  AWordApplication.Selection.ShapeRange.WrapFormat.type_ := 3;

  AWordApplication.Selection.ShapeRange.TextFrame.AutoSize := Integer(False);

  AWordApplication.Selection.ShapeRange.TextFrame.WordWrap := Integer(True);

End;

Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde Dich hier an.

Jetzt anmelden

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...