As I had to find out today, you cannot set the position of guidelines in PowerPoint from a VBA macro. But if you need a set of accurately positioned guidelines like shown in the screenshot below (exactly 32 vertical guidelines with the same distance between them), it would be almost impossible to position them by hand.
However, as you may know, PowerPoint’s PPTX files are simply zipped XML files, that can be extracted, analyzed (e.g. diffed), and modified. So I did exactly that and found out that the presentation’s guidelines are defined in ppt\viewProps.xml.
Having placed a single vertical guideline at both ends of the slide in an empty presentation, the corresponding part in viewProps.xml looks like this:
<p:guideLst>
<p:guide orient="horz" pos="2160"/>
<p:guide />
<p:guide pos="5760"/>
</p:guideLst>
So, the rightmost position of a guideline in PowerPoint’s internal unit of measurement (whatever that is) is 5760. Now you can divide this number by the number of guidelines you would like to have (32 in my case) and add new lines to the XML file accordingly:
<p:guideLst>
<p:guide orient="horz" pos="2160"/>
<p:guide />
<p:guide pos="180"/>
<p:guide pos="360"/>
...
<p:guide pos="5760"/>
</p:guideLst>
Now you can zip up the folder again, rename the file to pptx and open it in PowerPoint.
As the title of this blog post suggests, the above process could be automated. However, as zip file handling is not built in into PowerShell at the moment, I leave this exercise for the reader 😉