Solved

PowerPoint VBA: Why does "round dot" line style have wider dot spacing when set programmatically than when set manually?

Posted on 2014-02-01
3
881 Views
Last Modified: 2014-02-03
Has anybody run into this?  I'm using VBA to draw a circle shape, then set the line style to round dot.  It looks like the image on the left below.  But if I create the same shape manually (or edit the shape created by the macro) and go to format, shape outline, dashes, and choose round dot, it has tighter spacing between the dots, like the image on the right (which is what I want).  
circles
Sub testdottedcircle()

Dim newshape As Shape

Set newshape = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeOval, _
    Left:=63, Top:=179, Width:=198, Height:=198)
With newshape
    .Fill.Visible = msoFalse
    .Line.Visible = True
    .Line.Weight = 2
    .Line.DashStyle = msoLineRoundDot
    .Line.ForeColor.ObjectThemeColor = msoThemeColorLight1
End With

End Sub

Open in new window

Why don't I get the tighter dot spacing when I set this via VBA?   Does anybody know a workaround?

Thanks
0
Comment
Question by:versatilebb
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 39827357
msoLineRoundDot sounds correct but it isn't

Try:

.Line.DashStyle = msoLineSysDot
0
 

Author Comment

by:versatilebb
ID: 39831446
Thanks,

That gets me part way there.  The dots are closer together which is what I need, but now they are square dots.  To manually get the look I need I have to change the Cap Type to round.  

more circles
Is there a way to change the cap type to round in VBA?
0
 

Author Comment

by:versatilebb
ID: 39831450
I just answered my own question.  You need to first use RoundDot, then immediately use SysDot.  This gives rounds dots, closely spaced.

    .Line.DashStyle = msoLineRoundDot
    .Line.DashStyle = msoLineSysDot
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now