View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Dom[_4_] Dom[_4_] is offline
external usenet poster
 
Posts: 11
Default alignment of SOME text in a textbox

On Jun 16, 6:16*pm, "Clif McIrvin" wrote:
"Dom" wrote in message

...
[ ]

I'm using 2007. *Are we talking about the same thing? *By textbox, I
mean the textbox shape, what you get from the INSERT ribbon. *Not the
multiline text box you might see on a form. *Also, you must have an
actual new line, not just text that has wrapped automatically. *For
example, try "This is<CRa new line". *You can make "This is" align
left, and "a new line" align right.

-----------

Using the xl2010 macro recorder, I get this:

* * ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 153,
38.25, 150, _
* * * * 144.75).Select
* * Selection.ShapeRange(1).TextFrame2.TextRange.Chara cters.Text = _
* * * * "This is " & Chr(13) & "A new Line" & Chr(13) & ""
* * With Selection.ShapeRange(1).TextFrame2.TextRange.Chara cters(1, 9).
_
* * * * ParagraphFormat
* * * .FirstLineIndent = 0
* * * .Alignment = msoAlignRight
* * End With

HTH!

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


Thanks, Cliff, but I'm guessing this only works in 2010, not 2007. I
get an "Object doesn't support this property" error.

Thanks, again, but I think it's a lost cause.

Dom