Solved

Using macros to insert controls into powerpoint slides

Posted on 2003-10-27
5
882 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:
smozgur 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:smozgur
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: dandraka
There are several quick shortcuts that can make your life easier in Microsoft Programs.  These simple tips and tricks will your work more productive and you faster at completing your tasks! MS Word (1) Creating Re-usable Scraps You can create s…
Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

743 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

9 Experts available now in Live!

Get 1:1 Help Now