Question

Simple question for late evening...like the header says, what is msoTextOrientationHorizontal?

I wish to late bind the code for controlling MS PowerPoint in VBA, but can't seem to find what would be the constant value of msoTextOrientationHorizontal from the PowerPoint 11.0 library.

Dim objPPTApp As Object
Dim oPPSlide As Object
Dim oPPShape As Object
Const ppLayoutBlank = 12

Set objPPTApp = CreateObject("Powerpoint.Application")
Set oPPSlide = objPPTApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Set oPPShape = oPPSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 256, 28)

to something like

Dim objPPTApp As Object
Dim oPPSlide As Object
Dim oPPShape As Object
Const ppLayoutBlank = 12
Const msoTextOrientationHorizontal= 0 '## Value needed 

Set objPPTApp = CreateObject("Powerpoint.Application")
Set oPPSlide = objPPTApp.ActivePresentation.Slides.Add(1, 12)
Set oPPShape = oPPSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 256, 28)

Thanks for all your support!

Was it helpful?

Solution

From "Microsoft Office 14.0 Object Library":

typedef enum {
    msoTextOrientationMixed = 0xfffffffe, // -2
    msoTextOrientationHorizontal = 1, // <<-- This is the one you need
    msoTextOrientationUpward = 2,
    msoTextOrientationDownward = 3,
    msoTextOrientationVerticalFarEast = 4,
    msoTextOrientationVertical = 5,
    msoTextOrientationHorizontalRotatedFarEast = 6
} MsoTextOrientation;

OTHER TIPS

And more generally, you know about the object browser? Open the app you want to automate (or set a reference to it), then press F2 in the IDE. You'll be able to search for the constant you're after and find its value in the bottommost pane.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top