Solved

library to include for MsoScaleFrom constants

Posted on 2004-05-02
9
330 Views
Last Modified: 2013-12-26
Hi all, I am programming an
application that poduces Power Point slides.
Which references do I have to include in order
to have access to MsoScaleFrom constants and
other constants from power point (msoFalse, msoTrue, etc.)?

Thank you very much,

rr.
0
Comment
Question by:rrgw
  • 3
  • 3
  • 3
9 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 10975056
How to make a powerpoint show in VB, and after show how to stop it?
o call a powerpoint presentation from vb:
Remark, the 5 seconds between each slide has to be defined in the powerpoint presentation self.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Button Code -

Private Sub btnKernel_Click()

    Dim sFile As String
    sFile = "C:\3-box.ppt"
    Call ShellExecute(hwnd, "Open", (sFile), "", App.Path, 0)

End Sub
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 10975059
Another possibility: add a reference to the powerpoint object library in your project...

Dim appPPT As PowerPoint.Application
Set appPPT = PowerPoint.Application

Dim myPres As Presentation
Set myPres = Presentations.Open(FileName:="c:\My documents\pres1.ppt")
myPres.Windows(1).ViewType = ppViewSlideSorter

With ActivePresentation.SlideShowSettings
    .StartingSlide = 2
    .EndingSlide = 4
    .RangeType = ppShowSlideRange
    .AdvanceMode = ppSlideShowUseSlideTimings
    .LoopUntilStopped = True
    .Run
End With
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 10975064
--> Display PowerPoint slide show within a VB form or control window

http://www.mvps.org/skp/vb/pptvbwnd.htm
0
 

Author Comment

by:rrgw
ID: 10975171
Hi Dhaest,

I programmed the second option, that is:

Dim appPPT As PowerPoint.Application
Set appPPT = PowerPoint.Application

etc.

The problem is: when I compile things like:

    With logo
        .IncrementTop 393.75
        .ScaleWidth 0.48, msoFalse, msoScaleFromTopLeft
        .ScaleHeight 0.48, msoFalse, _
 msoScaleFromBottomRight
end with

VB complains that constants msoFalse,
msoScaleFromTopLeft and msoScaleFromBottomRight
are undefined.

I am not worried about playing the presentation, because
it will be played afterwards. The program is just to
building the presentation, not playing it.

I found MSPPT.OLB in my disk. Do I have to include it
as a reference or something like that?
I already included the Microsoft PowerPoint 10.0 object library (it was there when VB complained). Is this MSPPT.OLB another one?

Thanks,

rr.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:OHDev2004
ID: 10975841
instead of msoFalse use False or 0
instead of msoTrue use False or 1
OHDev2004
0
 

Author Comment

by:rrgw
ID: 10994838
Thanks OHDev2004, but what about the values of the MSOScaleFrom constants?
(msoScaleFromBottomRight, msoScaleFromMiddle, msoScaleFromTopLeft)

rr.
0
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 50 total points
ID: 10996124
Here are the values of these constants

msoScaleFromBottomRight =2
msoScaleFromTopLeft=0
msoScaleFromMiddle=1

Tip: if you want to know any value of any constant :
open PowerPoint - Tools Menu - Macro - Visual Basic Editor :
then in any event like the following:

Private Sub UserForm_Initialize()
Msgbox  msoScaleFromBottomRight
End Sub

This will show you the value of the COnstant :)
Thanks,,
OHDev2004
0
 

Author Comment

by:rrgw
ID: 11001497
Thank you, OHDev2004
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 11004277
Ur welcome :)
OHDev2004
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now