Link to home
Start Free TrialLog in
Avatar of hj_daisy
hj_daisyFlag for Afghanistan

asked on

PowerPoint VBA 2010 Insert text with different formatting and line spacing into one shape

What I am trying to do is use PowerPoint VBA to select a shape which I have already assigned the name of "Address" to.

Then I need the VBA code to type in text, insert blank line and change line spacing, type more text in bold etc.  So what I am trying to do is put in multiple lines of text that will need different font sizes and line spacing assigned to it.  Here is an example of what is to be inserted into the shape:

Presented by: (this is in Arial 12 Bold, line spacing 1.0)
(blank line using 0.8 spacing)
ABC Company (this is in bold Arial 14 font, line spacing 1.2)
(blank line using 1.0 spacing)
Tel: 1234567 (in Arial 8 point font, line spacing 0.8)

The above gives enough of an idea of what I'm trying to do.  I'm so stumped with the VBA code to apply the formatting.   The information that I will be inserting will be based on what the user provides and this will change all the time so I need to always update this shape with the latest information.

Thank you for any VBA code examples that you can give.

regards
Helen
ASKER CERTIFIED SOLUTION
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rgonzo1971
Rgonzo1971

@Jamie

at line 37 correct to
     With .Paragraphs(4)
Avatar of hj_daisy

ASKER

Wonderful, thank you for the code and help you have given.

regards
Helen