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
852 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

 Regular Expressions Microsoft Word has sophisticated search tools that can search for patterns. For example if you wanted to search for all UK phone numbers that followed a pattern of five digits, a space and then six digits you can easily do th…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

708 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

9 Experts available now in Live!

Get 1:1 Help Now