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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
This article will show you how to use shortcut menus in the Access run-time environment.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
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 …

820 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