Get WordArt object from Powerpoint Slide

M

manoj

Hi All,

I am working on a C#.NET application.In which I need to get all the
powerpoint slide objects and convert them into flash (.swf) format. I am
using Microsoft Powerpoint 12.0 Object Library to read objects from slide. I
am able to extract text and images from a pptx slide and convert it into
flash file format. But I am getting problem to read WordArt object from slide.

Microsoft documentation says there is TextEffectFormat object for WordArt
and TextFrame object for plain text. But TextEffectFormat object works for
both plain text and WordArt. Then how can you identify that WordArt is
applied on this text or not ? It's very important for me to differentiate as
i need to apply different conversion methods for plain text and WordArt ?

Can anybody tell me how to differentiate between plain text and WordArt in
Powerpoint slide shape ? I would be very thankful to you for your help.

Thanks,
Manoj
 
M

manoj

Hi Steve,

Thanks for your quick reply. I tried your solutions but no success yet. :-(

I want to tell you more about my problem. You can add WordArt in 2 ways in
Powerpoint 2007

1) You can directly insert WordArt into your slide. I call this WordArt Only.
2) You can first write text into your slide and then applied WordArt on it.
I call this text + WordArt

and there is plain text also. I call this Text Only.

There is no problem to differentiate between Text and WordArt Only. But Its
difficult to differentiate between Text And Text + WordArt

For Example

Value of Shape.Type For

Text Only - msoPlaceholder
Text + WordArt - msoPlaceholder (again)
WordArt Only - msoAutoShape

(You can differentiate WordArt by Shape.Type value)

Then

Value of Shape.TextFrame2.WordArtFormat For

Text Only - MsoTextEffectMixed
Text + WordArt - MsoTextEffectMixed (again)
WordArt Only - MsoTextEffect15

As you can see Text and Text + WordArt both are giving same values in every
case. So how to differentiate them ?

WordArtFormat never return -1 even if it is Plain Text. It return -2
(MsoTextEffectMixed) in both Text and Text + WordArt case.

I also try to assign -2 value to WordArtFormat but it gives me error in each
case.

Can you suggest me what to do in this case ?

Once again Thank you so much for your reply.

Regards,
Manoj


 
S

Shyam Pillai

If the text has no wordart in it or if the text range you are querying has a
text and a wordart in it it will return -2. Query each run of the text range
and you will be able to determine which range has the wordart. Look up the
Runs object associated with the TextRange.

Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.com






manoj said:
Hi Steve,

Thanks for your quick reply. I tried your solutions but no success yet.
:-(

I want to tell you more about my problem. You can add WordArt in 2 ways in
Powerpoint 2007

1) You can directly insert WordArt into your slide. I call this WordArt
Only.
2) You can first write text into your slide and then applied WordArt on
it.
I call this text + WordArt

and there is plain text also. I call this Text Only.

There is no problem to differentiate between Text and WordArt Only. But
Its
difficult to differentiate between Text And Text + WordArt

For Example

Value of Shape.Type For

Text Only - msoPlaceholder
Text + WordArt - msoPlaceholder (again)
WordArt Only - msoAutoShape

(You can differentiate WordArt by Shape.Type value)

Then

Value of Shape.TextFrame2.WordArtFormat For

Text Only - MsoTextEffectMixed
Text + WordArt - MsoTextEffectMixed (again)
WordArt Only - MsoTextEffect15

As you can see Text and Text + WordArt both are giving same values in
every
case. So how to differentiate them ?

WordArtFormat never return -1 even if it is Plain Text. It return -2
(MsoTextEffectMixed) in both Text and Text + WordArt case.

I also try to assign -2 value to WordArtFormat but it gives me error in
each
case.

Can you suggest me what to do in this case ?

Once again Thank you so much for your reply.

Regards,
Manoj
 
S

Shyam Pillai

Let me add that the WordArtFormat property only works if the effect is a
preset from the UI. You can create any text effect using the all the
properties available in PPT 2007.

Regards,
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm



Shyam Pillai said:
If the text has no wordart in it or if the text range you are querying has
a text and a wordart in it it will return -2. Query each run of the text
range and you will be able to determine which range has the wordart. Look
up the Runs object associated with the TextRange.

Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.com
 

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