Solved

Using macros to insert controls into powerpoint slides

Posted on 2003-10-27
5
887 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

734 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