Lines object in a TextFrame

M

mcalex

Hi

I'm trying to change the first line of a three line TextBox containing
the slide's title. Each customer has their name as the first line of
the title, but the type and year of data are the same, so I only want
to change the first line. The slide's title is Customer Name //
2004/05 // Sales Data, where // represents a new line. I am trying to
use the Lines() method in TextBox.TextFrame, but it doesn't keep line
breaks. Ie when I use: titleShape.TextFrame.TextRange.Lines(1, 3) =
"Customer Name" the title ends up as Customer Name2004/05, instead of
the 2004/05 bit remaining on the next line. Aha, I thought, I'll just
add my own line breaks. But \n and \u010, didn't work, so I gave up
on that idea. Trying to get a TextRange with different amounts of
lines in doesn't work either (ie, changing the second parm to the
Lines method). Anyone got any hints? I'd prefer to not have to have
a title shape with one line, and sub-title shape with the other two,
but that's what I'm resigned to at the moment.

Hope this all makes sense, I'm new at MS.

Cheers
Alex
 
C

Chad DeMeyer

Did you try using the VB constant vbCr (carriage return) or vbCrLf (carriage
return-line feed) for adding your own line breaks?

Regards,
Chad
 
M

mcalex

Chad DeMeyer said:
Did you try using the VB constant vbCr (carriage return) or vbCrLf (carriage
return-line feed) for adding your own line breaks?

Regards,
Chad
I have now. :)
Thanks mate, problem fixed! BTW, is there a list somewhere of vb
(and/or mso) constants? I keep seeing one or two pop up when i
<Ctrl-Space>, but would like to know what all of em are.

thx again
Alex
 
C

Chad DeMeyer

The easiest way is to open the Visual Basic Editor from any Office app and
go to the object browser. The vb and mso constants are members of the
Global class. Let me just say that there are a LOT of them.

Regards,
Chad
 
A

Andrew Cushen

FYI, You can quickly open the VBA Editor from any Office
app by hitting Alt-F11, and once the Editor is open, F2
will open the Object Browser.


-Andrew
=======================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top