Solved

Using macros to insert controls into powerpoint slides

Posted on 2003-10-27
5
883 Views
Last Modified: 2012-08-14
I have this problem that require me to insert a Forms image control into a powerpoing slide using macros.  I found that there are actually two ways that I can do it.  That is, to use Control.Add or AddOleObject.  The problem is that I do not know how to use them.  Specifically, what objects to call them with.  Or maybe there are other ways of adding a control in macros of powerpoint slides?  
0
Comment
Question by:ketani
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Suat Ozgur earned 250 total points
ID: 9632791
You can also add controls by using Controls toolbar, so you don't have to create them in code.

>The problem is that I do not know how to use them.

What do you mean ? Can you be more specific ?

Do you want to set a property of a control ? For example- do you need to load a picture into the image control ? Or set image picture size mode ?

All these and more could be done manually in properties window. Say you inserted image control (View->Toolbars->Visual Basic -> Controls Toolbox) then you just right click on the control and point to Properties.

Oh, if you ask to do these in code, then it is of course still possible but we should know what you exactly want to do.

Suat
0
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 9632797
Easier access to controls toolbox which is mentioned in my comment above:

View->Toolbars-> Controls Toolbox

Suat
0
 
LVL 24

Assisted Solution

by:R_Rajesh
R_Rajesh earned 250 total points
ID: 9632804
Hey ! ketani,

I am not sure if i understand you correctly. but if you mean adding controls to a slide through macro at runtime, you can use this code. If this is not what you want please clarify your question and what you plan to do with these controls.

-------------------
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=138#, Top:=384#, Width:=150#, Height:=60#, ClassName:="Forms.Image.1", Link:=msoFalse).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=138#, Top:=168#, Width:=126#, Height:=60#, ClassName:="Forms.CommandButton.1", Link:=msoFalse).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=132#, Top:=264#, Width:=138#, Height:=54#, ClassName:="Forms.TextBox.1", Link:=msoFalse).Select
    ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=132#, Top:=342#, Width:=144#, Height:=42#, ClassName:="Forms.Label.1", Link:=msoFalse).Select
-----------------------------
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Perhaps more familiar to developers who primarily use VBScript than to developers who tend to work only with Microsoft Office and Visual Basic for Applications (VBA), the Dictionary is a powerful and versatile class, and is useful …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

920 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

12 Experts available now in Live!

Get 1:1 Help Now