Hallo Zusammen,
ich möchte gerne eine Textbox in einem Worddokument in der Kopfzeile erscheinen lassen. Leider kommt immer wieder ein Laufzeitfehler.
Hoffe es mir mir jemand bei meinem Problem helfen:
Code:
Dim oShape As Shape, oRange As Range, oShape2 As Shape, höhe_textbox As Double, breite_textbox As Double, text As String, links As Double, höhe As Double
höhe_textbox = CentimetersToPoints(1.03) ' * 28.3464567
breite_textbox = 18.22 * 28.3464567 '
links = CentimetersToPoints(2#) '* 28.3464567
höhe = CentimetersToPoints(1.8) '* 28.3464567
Set oRange = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, links, _
höhe, breite_textbox, höhe_textbox, oRange).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.Font.Color = RGB(0, 78, 43)
Selection.Font.Size = 18
Selection.Font.Name = "Candara"
Selection.Font.Bold = True
Selection.Font.SmallCaps = True
Selection.ShapeRange.Line.Visible = msoFalse 'damit man den Rahmen von der Textbox nicht sieht
Selection.TypeText (inhalt) 'Damit alles groß geschrieben wird
|