Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the unit of measure for PowerPoint slides using VBA?

Tags:

powerpoint

vba

I am using VBA to paste charts/graphs from Access to PowerPoint. Once pasted, I am resizing them using VBA, but it does not allow me to use inches (even though when I do it manually through the shape Properties, the size values there are in inches).

My question is what unit of measure is the number I use in VBA? I assumed pixels and tried to convert using a 96 pixel per inch factor, but that wasn't just right. Now I'm curious about whether it's based on my screen resolution? I can quickly code it (through trial and error) to look good on my machine, but I worry then if somebody else runs it, and they have a different resolution, the slide will look different. (Note that the graphs are having to fit within other shapes.)

If it's not based on screen resolution, does anybody know the dimensions of a slide in whatever unit it's in?

like image 861
rryanp Avatar asked Jun 28 '12 19:06

rryanp


People also ask

How do you measure in PowerPoint?

On the PowerPoint menu, select Preferences, and then select View. Click the arrow next to Ruler units, and select a unit of measure from the list.

How do I write VBA code in PowerPoint?

Press ALT+F11 to start the VBA editor. Or click the Office button, choose PowerPoint Options, click Popular and put a check next to Show Developer tab in Ribbon. Close the options dialog box, click the Developer tab then click Visual Basic to start the editor.

Does VBA work in PowerPoint?

Using VBA, we can automate the work we do for PowerPoint. But first, to use VBA code or snippets to work in PowerPoint, first work through the security options in PowerPoint to enable all Macros. Then, we can use PowerPoint VBA reference for Macros in MS PowerPoint.

How do I view the VBA code in PowerPoint?

Here's how you can find macros and VBA modules in your document: In Word or Excel, click View > Macro > View Macros. In PowerPoint, click View > Macro.


2 Answers

Units in ppt VBA are Points (a point is about 1/72 of an inch)

like image 76
Tim Williams Avatar answered Oct 16 '22 15:10

Tim Williams


Pardon the pedanticism, but an inch is exactly 72 points, at least as far as PowerPoint and pretty much any digital system is concerned.

Before computers took over, "about" did indeed apply. All the more so because there were several different "standard" definitions of the point.

http://en.wikipedia.org/wiki/Point_(typography)

AAMOF, at one ... er ... point, Microsoft redefined the cm (2.4 to the inch instead of 2.54) to suit its own purposes, leading to confusion when people in the metric climes precisely specified measurements in PowerPoint then found out that things didn't print at the expected size.

They fixed this in PPT 2002, but I'd be there are still files floating around that, when opened in current versions of the app, show odd page sizes.

like image 32
Steve Rindsberg Avatar answered Oct 16 '22 15:10

Steve Rindsberg