Solved

Using VBA in MS/Access to build PowerPoint Slides

Posted on 2009-04-06
4
313 Views
Last Modified: 2013-11-28
I am building a set of PowerPoint using VBA inside Microsoft Access 2003.  I need to know how to tell the PowerPoint object how to place a text box directly under another one.  Problem is, I don't know how big the first text box is because the contents may vary each time I run the code.  Maybe there's a better way to do multi-line text boxes that consist of multiple records from a database recordset.  Is there any way to tell at which X value pixel or screen location you currently are set?  Any assistance would be appreciated.
0
Comment
Question by:rdbrunet
[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
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 24081737
0
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 250 total points
ID: 24084241
The following code iterates through all shapes on a slide ... slide 1 as defined but you can as easily increment the limits as you add a shape.

Chris
Dim pptApp As Object
Dim pres As Object
Dim pptSlide As Slide
Dim shp As Shape
Dim lngTop As Long
Dim lngleft As Long
Dim lngBottom As Long
Dim lngright As Long
 
    
    Set pptApp = Application
    Set pres = ActivePresentation
    With pptApp
        With pres
            Set pptSlide = .Slides(1)
            lngleft = pptSlide.Shapes(1).Left
            lngTop = pptSlide.Shapes(1).Top
            For Each shp In pptSlide.Shapes
                If shp.Left < lngleft Then lngleft = shp.Left
                If shp.Top < lngTop Then lngTop = shp.Top
                If shp.Left + shp.Width > lngright Then lngright = shp.Left + shp.Width
                If shp.Top + shp.Height > lngBottom Then lngBottom = shp.Top + shp.Height
            Next
        End With
    End With

Open in new window

0
 

Author Comment

by:rdbrunet
ID: 24092772
Thanks for the feedback.  I actually figured out that if I counted the characters using the LEN() function, I could pre-determine the amount of space I needed to allocate in PowerPoint for the text box shape.  Works like a charm.
0
 

Author Closing Comment

by:rdbrunet
ID: 31567242
These were good pointers although they did not directly address the issue I was experiencing.  Thanks for the feedback.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

732 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