VBA formatting

K

KoldKay

Hi all,
I'm having some problems formatting text.
I've got a database that has multiple line text. It displays
correctly in Access as being on two lines. However, when I export
that text via XML into Powerpoint, it doesn't register the New Line
properly.
Is there any way to get Powerpoint to parse this correctly?

Also, when using the *.Shapes(2).TextFrame.TextRange.Text commands
etc, how can I insert a line of text at the next indentation level [As
displayed on the Master slide]. Is that possible without using
the .Range function?

Thanks
Michael
 
K

KoldKay

Hi all,
I'm having some problems formatting text.
I've got a database that has multiple line text. It displays
correctly in Access as being on two lines. However, when I export
that text via XML into Powerpoint, it doesn't register the New Line
properly.
Is there any way to get Powerpoint to parse this correctly?

Also, when using the *.Shapes(2).TextFrame.TextRange.Text commands
etc, how can I insert a line of text at the next indentation level [As
displayed on the Master slide]. Is that possible without using
the .Range function?

Thanks
Michael

PS, by New line, I mean chr13. I need to paste the text direct from
an XML stream and have it register - but it doesn't seem to do that,
it just shows as a square..
 
D

David M. Marcovitz

Michael,

I'm not sure about your first question. Perhaps, you can figure out what
is getting pasted instead of chr$(13) and do a find and replace (with
VBA).

As for your second question, try something like this:

With ActivePresentation.Slides(2).Shapes(2).TextFrame.TextRange
.Paragraphs(.Paragraphs.Count).IndentLevel = _
.Paragraphs(.Paragraphs.Count).IndentLevel + 1
End With

It will take the last paragraph of a shape (shape 2 on slide 2 in this
case, but you can adjust that) and indent it one more level. If you do
this right after inserting a paragraph, it should put that paragraph at
the next indentation level.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
S

Steve Rindsberg

KoldKay said:
Hi all,
I'm having some problems formatting text.
I've got a database that has multiple line text. It displays
correctly in Access as being on two lines. However, when I export
that text via XML into Powerpoint, it doesn't register the New Line
properly.
Is there any way to get Powerpoint to parse this correctly?

Also, when using the *.Shapes(2).TextFrame.TextRange.Text commands
etc, how can I insert a line of text at the next indentation level [As
displayed on the Master slide]. Is that possible without using
the .Range function?

Thanks
Michael

PS, by New line, I mean chr13. I need to paste the text direct from
an XML stream and have it register - but it doesn't seem to do that,
it just shows as a square..

Line breaks in PPT are represented by Chr10, paragraph endings by Chr13&Chr10

Try replacing each Chr13 with Chr13&Chr10
 
K

KoldKay

Michael,

I'm not sure about your first question. Perhaps, you can figure out what
is getting pasted instead of chr$(13) and do a find and replace (with
VBA).

As for your second question, try something like this:

With ActivePresentation.Slides(2).Shapes(2).TextFrame.TextRange
.Paragraphs(.Paragraphs.Count).IndentLevel = _
.Paragraphs(.Paragraphs.Count).IndentLevel + 1
End With

It will take the last paragraph of a shape (shape 2 on slide 2 in this
case, but you can adjust that) and indent it one more level. If you do
this right after inserting a paragraph, it should put that paragraph at
the next indentation level.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_http://www.PowerfulPowerPoint.com/

Hi all,
I'm having some problems formatting text.
I've got a database that has multiple line text. It displays
correctly in Access as being on two lines. However, when I export
that text via XML into Powerpoint, it doesn't register the New Line
properly.
Is there any way to get Powerpoint to parse this correctly?
Also, when using the *.Shapes(2).TextFrame.TextRange.Text commands
etc, how can I insert a line of text at the next indentation level [As
displayed on the Master slide]. Is that possible without using
the .Range function?
Thanks
Michael

Thanks all, it was very useful, especially David's bit of code about
the indentation level.

Thanks again
Michael
 

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