![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
Powerpoint underline style
I can't figure out the syntax for the new underline styles in Powerpoint 2007 onwards. I need to set a dotted underline to a TextRange (underline style > dotted line from the Font dialog) but can't find the attribute. I can only work out how to turn on underline and it uses the default solid underline.
Code currently like this.. With rngUnderline .Font.Underline = msoTrue End With You'd think there was a .Font.Underline.Style property but seemingly not. Anyone got any ideas? Last edited by lesaussice : 04-16-2012 at 04:42 AM. |
|
Local Time: 01:12 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#2 |
|
|
To use the new text features you must work with the TextFrame2 object. In 2007 this is a bit broken so you might want to explain how you referenced mgunderline. In 2010 you can use TextRange2.
VBA:
VBA tags courtesy of www.thecodenet.com
John Wilson Microsoft PowerPoint MVP Amazing Free PowerPoint Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html |
|
Local Time: 01:12 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#3 |
|
|
John,
Great, that's solved it.. RngUnderline was set to a specific character range via the TextFrame rather than the TextFrame2 object. Like you say, things are a bit broken in PPT 2007 but I'm now able to use UnderlineStyle to apply my dotted underline. Cheers |
|
Local Time: 01:12 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#4 |
|
|
Can you try changing the undeline color with vba and tell me what you see.
John Wilson Microsoft PowerPoint MVP Amazing Free PowerPoint Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html |
|
Local Time: 01:12 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#5 |
|
|
Sorry.. Taken me a while to come back to this. I did get around the problem, but I had to do it by referring to the shape's textframe2 (and then the characters within it) rather than setting those characters as a range and then applying the underlinestyle to it. The latter (bizarely) results in PPT not exposing the relevant properties.
Coming from Excel / Access, PPT VBA is quite odd and seems a bit unloved by MS.. |
|
Local Time: 01:12 AM
Local Date: 05-24-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


