?
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
Medium Priority
?
1,000 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:Bryce Bassett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

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

Try:

.Line.DashStyle = msoLineSysDot
0
 

Author Comment

by:Bryce Bassett
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:Bryce Bassett
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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

777 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