Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using macros to insert controls into powerpoint slides

Posted on 2003-10-27
5
Medium Priority
?
891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Suat Ozgur earned 1000 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 1000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

721 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