?
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,090 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
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

862 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