Solved

Using macros to insert controls into powerpoint slides

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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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