1

Visual Basic 2010 で (テキストが折り返されないと仮定して) テキスト ボックスを「合わせる」方法が知られているかどうか知りたいです。 PowerPoint の GUI のように、新しく作成されたテキスト ボックスが単純に 1 つのタイプとして展開されます。私のコードは次のとおりです。

Set tbox1 = slideObject.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=20, Top:=300, Width:=72, Height:=16)

With tbox1.TextFrame.TextRange
  .Text = "the text in the text box"
  .Font.Bold = True
  .Font.Name = "Calibri"
  .Font.Size = 10
End With

With tbox1.Fill
  .Visible = True
  .ForeColor.RGB = RGB(255, 255, 255)
End With

With tbox1.Line
  .Visible = True
  .ForeColor.RGB = RGB(0, 0, 0)
  .Weight = 2
End With

助けてくれてありがとう!!!

4

2 に答える 2

4

これにより形状のサイズが変更されますが、ワードラップを許可すると、1行に1文字の背の高い細い形状になります...

tbox1.TextFrame.WordWrap = False
tbox1.TextFrame.AutoSize = ppAutoSizeShapeToFitText

ラップするテキストが必要ですか?

于 2014-01-07T19:25:50.980 に答える