Hi,
I am working on a PowerPoint automation assignment. I need to draw a custom dash like we do in Word documents using Stroke object. In stroke object you can specify the dash length followed by space b/w dashes. I tried finding it for PowerPoint and found CustomDash class but I am not able to use it the same way we use the Stroke class for Word.
Can anyone help me in drawing custom dash in PowerPoint using the Stroke approach?
Looking forward to hearing from you.
Thanks.
Any help?
The best way to research the markup - create a powerpoint presentation with the custom content that you desire, and then look at the markup. Can you post a powerpoint presentation that contains the content that you need?
-Eric
Hi Eric,
Nice to hear from you. I started thinking that perhaps no one here to help me in this regard but fortunate enough to get your attention.
I actually don't have any PowerPoint presentation with me. I am getting input from a third party API that is giving information in the form of "2 3" which mean line dash of size 2 and 3 spaces b/w dashes. This is the same information we get from stroke object detail in MSDN. Here is what MSDN says:
A custom-defined dash pattern can also be specified using a series of numbers. These define the length of the dash (the drawn part of the stroke) and the length of the space between the dashes. The lengths are relative to the line width: a length of 1 is equal to the line width.
link: msdn.microsoft.com/.../documentformat.openxml.vml.stroke.aspx
I followed it and have successfully created custom dash styles in Word document (.docx) but I am not able to use this in PowerPoint.
My Word code is like:
Dim stroke As V.Stroke = Nothing
'' Build line style
Dim dashStyle As String = "dash"
If (Command.LineDash.Length >= 3) Then
dashStyle = String.Format("{0} {1}", Command.LineDash(0), Command.LineDash(2))
End If
stroke = New V.Stroke() With
{.DashStyle = dashStyle}
line.Append(stroke)
It works great in Word but no success in case of PowerPoint. Any help?
Thanks in anticipation.