Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Positionierung von Textbox in Worddokument über Delphi

Empfohlene Antworten

Veröffentlicht

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;

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.