Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 14th, 2006, 03:56 AM
Phoenix_riser Phoenix_riser is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 225 Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 2 h 28 m 15 sec
Reputation Power: 15
VB6 automating powerpoint -close but need a bit of help now

I found this code and had a play but what I would love it to automate 11 lines - on seperate boxes. This is because between each line an image comes up to the left (I'll work on that next).

It only lets me have two lines - help?!

Code:
Private Sub Command1_Click()
    ' Start PowerPoint.
    Dim ppApp As PowerPoint.Application
    Set ppApp = CreateObject("Powerpoint.Application")
        
    ' Make it visible.
    ppApp.Visible = True
 
    ' Add a new presentation.
    Dim ppPres As PowerPoint.Presentation
    Set ppPres = ppApp.Presentations.Add(msoTrue)
 
    ' Add a new slide.
    Dim ppSlide1 As PowerPoint.Slide
    Set ppSlide1 = ppPres.Slides.Add(1, ppLayoutText)
    
    ' Add some text.
    ppSlide1.Shapes(1).TextFrame.TextRange.Text = "My first slide"
    ppSlide1.Shapes(2).TextFrame.TextRange.Text = "Automating Powerpoint-" & vbCr & "with VB6!"
    
    ' Add another slide, with a chart.
    Dim ppSlide2 As PowerPoint.Slide
    Set ppSlide2 = ppPres.Slides.Add(2, ppLayoutTextAndChart)
    
    ' Add some text.
    ppSlide2.Shapes(1).TextFrame.TextRange.Text = "Slide 2's topic"
    ppSlide2.Shapes(2).TextFrame.TextRange.Text = "You can create and use charts in your Powerpoint slides!"
    ppSlide2.Shapes(3).TextFrame.TextRange.Text = "You can create and use charts in your Powerpoint slides!"
 
    ' Add a chart in the same location as the old one.
    Dim cTop As Double
    Dim cWidth As Double
    Dim cHeight As Double
    Dim cLeft As Double
    With ppSlide2.Shapes(3)
        cTop = .Top
        cWidth = .Width
        cHeight = .Height
        cLeft = .Left
        .Delete
    End With
    ppSlide2.Shapes.AddOLEObject cLeft, cTop, cWidth, cHeight, "MSGraph.Chart"
 
    ' Add another slide, with an organization chart.
    Dim ppSlide3 As PowerPoint.Slide
    Set ppSlide3 = ppPres.Slides.Add(3, ppLayoutOrgchart)
 
    ' Add some text.

    ppSlide3.Shapes(1).TextFrame.TextRange.Text = "The rest is only limited by your Imagination"
 
    ' Add an Org Chart in the same location as the old one.
    With ppSlide3.Shapes(2)
        cTop = .Top
        cWidth = .Width
        cHeight = .Height
        cLeft = .Left
        .Delete
    End With
    ppSlide3.Shapes.AddOLEObject cLeft, cTop, cWidth, cHeight, "OrgPlusWOPX.4" 'OrgPlusWOPX.4
    ' is an object of the application Microsoft Organization Chart

 
    ' Setup slide show properties.
    With ppPres.Slides.Range.SlideShowTransition
        .EntryEffect = ppEffectRandom
        .AdvanceOnTime = msoTrue
        .AdvanceTime = 5 ' 5 seconds per slide
    End With
 
    ' Prepare and run the slide show.
    With ppPres.SlideShowSettings
        .ShowType = ppShowTypeKiosk
        .LoopUntilStopped = msoTrue

        .RangeType = ppShowAll
        .AdvanceMode = ppSlideShowUseSlideTimings
        .Run
    End With
 
    ' Sleep so user can watch the show.
    Sleep (15000)
 
    ' Clean up.
    ppApp.Quit

End Sub

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB6 automating powerpoint -close but need a bit of help now


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT