Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Populating a ListBox at runtime

 
   Windows Help (Home) -> Microsoft Powerpoint RSS
Next:  Side-by-side of different slide presentations  
Author Message
kimkom

External


Since: Nov 10, 2008
Posts: 3



(Msg. 1) Posted: Mon Nov 10, 2008 9:16 am
Post subject: Populating a ListBox at runtime
Archived from groups: microsoft>public>powerpoint (more info?)

Hi All,

I've been using the following code to populate a ListBox. The trouble is it
doesn't populate when double-clicking the PPS file to view the slideshow. I
understand why it's not populating (since it has to be run while the ListBox
is selected in edit mode), just not sure how to make it work at runtime.

Anyone got any pointers on how to fix it?

Many thanks,
Michael


Sub AddItemsToSelectedListBox()

Dim oShape As Shape
Set oShape = ActiveWindow.Selection.ShapeRange(1)

With oShape.OLEFormat.Object
.Clear
.AddItem ("FORMATION 01")
.AddItem ("FORMATION 02")
.AddItem ("FORMATION 03")
.AddItem ("FORMATION 04")
.AddItem ("FORMATION 05")
End With

End Sub

 >> Stay informed about: Populating a ListBox at runtime 
Back to top
Login to vote
Steve Rindsberg

External


Since: Nov 8, 2008
Posts: 108



(Msg. 2) Posted: Mon Nov 10, 2008 2:59 pm
Post subject: Re: Populating a ListBox at runtime
Archived from groups: per prev. post (more info?)

In article , Kimkom wrote:
> Hi All,
>
> I've been using the following code to populate a ListBox. The trouble is it
> doesn't populate when double-clicking the PPS file to view the slideshow. I
> understand why it's not populating (since it has to be run while the ListBox
> is selected in edit mode), just not sure how to make it work at runtime.
>
> Anyone got any pointers on how to fix it?

Never rely on selection more than you have to, other than for your own test use
(as when pre-naming shapes to make something like the following easier):

Use something like this instead:

Set oShape = ActivePresentation.Slides(42).Shapes("Bubba")



>
> Many thanks,
> Michael
>
> Sub AddItemsToSelectedListBox()
>
> Dim oShape As Shape
> Set oShape = ActiveWindow.Selection.ShapeRange(1)
>
> With oShape.OLEFormat.Object
> .Clear
> .AddItem ("FORMATION 01")
> .AddItem ("FORMATION 02")
> .AddItem ("FORMATION 03")
> .AddItem ("FORMATION 04")
> .AddItem ("FORMATION 05")
> End With
>
> End Sub
>

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: [URL="http://www.pptfaq.com"]www.pptfaq.com[/URL]
PPTools: [URL="http://www.pptools.com"]www.pptools.com[/URL]
================================================

 >> Stay informed about: Populating a ListBox at runtime 
Back to top
Login to vote
kimkom

External


Since: Nov 10, 2008
Posts: 3



(Msg. 3) Posted: Tue Nov 11, 2008 12:36 am
Post subject: Re: Populating a ListBox at runtime
Archived from groups: per prev. post (more info?)

Thank you for the reply and advice Steve.

Unfortunately replacing the Set oShape line with your suggested format of:
Set oShape = ActivePresentation.Slides(4).Shapes("ListBox1")

does not populate the list. Any further advice anyone?

I am also wondering if this is the correct way to go, since I don't want to
'AddItem' every time the PPS is run. I merely want to create the list and
have it stay the same with each run.

Many thanks,
Michael



"Steve Rindsberg" wrote:

> In article , Kimkom wrote:
> > Hi All,
> >
> > I've been using the following code to populate a ListBox. The trouble is it
> > doesn't populate when double-clicking the PPS file to view the slideshow. I
> > understand why it's not populating (since it has to be run while the ListBox
> > is selected in edit mode), just not sure how to make it work at runtime.
> >
> > Anyone got any pointers on how to fix it?
>
> Never rely on selection more than you have to, other than for your own test use
> (as when pre-naming shapes to make something like the following easier):
>
> Use something like this instead:
>
> Set oShape = ActivePresentation.Slides(42).Shapes("Bubba")
>
>
>
> >
> > Many thanks,
> > Michael
> >
> > Sub AddItemsToSelectedListBox()
> >
> > Dim oShape As Shape
> > Set oShape = ActiveWindow.Selection.ShapeRange(1)
> >
> > With oShape.OLEFormat.Object
> > .Clear
> > .AddItem ("FORMATION 01")
> > .AddItem ("FORMATION 02")
> > .AddItem ("FORMATION 03")
> > .AddItem ("FORMATION 04")
> > .AddItem ("FORMATION 05")
> > End With
> >
> > End Sub
> >
>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: [URL="http://www.pptfaq.com"]www.pptfaq.com[/URL]
> PPTools: [URL="http://www.pptools.com"]www.pptools.com[/URL]
> ================================================
>
>
>
 >> Stay informed about: Populating a ListBox at runtime 
Back to top
Login to vote
kimkom

External


Since: Nov 10, 2008
Posts: 3



(Msg. 4) Posted: Tue Nov 11, 2008 5:44 am
Post subject: Re: Populating a ListBox at runtime
Archived from groups: per prev. post (more info?)

I've managed to get this working fine now using Option Buttons instead of a
List Box.

Thanks,
Michael

"kimkom" wrote:

> Thank you for the reply and advice Steve.
>
> Unfortunately replacing the Set oShape line with your suggested format of:
> Set oShape = ActivePresentation.Slides(4).Shapes("ListBox1")
>
> does not populate the list. Any further advice anyone?
>
> I am also wondering if this is the correct way to go, since I don't want to
> 'AddItem' every time the PPS is run. I merely want to create the list and
> have it stay the same with each run.
>
> Many thanks,
> Michael
>
>
>
> "Steve Rindsberg" wrote:
>
> > In article , Kimkom wrote:
> > > Hi All,
> > >
> > > I've been using the following code to populate a ListBox. The trouble is it
> > > doesn't populate when double-clicking the PPS file to view the slideshow. I
> > > understand why it's not populating (since it has to be run while the ListBox
> > > is selected in edit mode), just not sure how to make it work at runtime.
> > >
> > > Anyone got any pointers on how to fix it?
> >
> > Never rely on selection more than you have to, other than for your own test use
> > (as when pre-naming shapes to make something like the following easier):
> >
> > Use something like this instead:
> >
> > Set oShape = ActivePresentation.Slides(42).Shapes("Bubba")
> >
> >
> >
> > >
> > > Many thanks,
> > > Michael
> > >
> > > Sub AddItemsToSelectedListBox()
> > >
> > > Dim oShape As Shape
> > > Set oShape = ActiveWindow.Selection.ShapeRange(1)
> > >
> > > With oShape.OLEFormat.Object
> > > .Clear
> > > .AddItem ("FORMATION 01")
> > > .AddItem ("FORMATION 02")
> > > .AddItem ("FORMATION 03")
> > > .AddItem ("FORMATION 04")
> > > .AddItem ("FORMATION 05")
> > > End With
> > >
> > > End Sub
> > >
> >
> > -----------------------------------------
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: [URL="http://www.pptfaq.com"]www.pptfaq.com[/URL]
> > PPTools: [URL="http://www.pptools.com"]www.pptools.com[/URL]
> > ================================================
> >
> >
> >
 >> Stay informed about: Populating a ListBox at runtime 
Back to top
Login to vote
Steve Rindsberg

External


Since: Nov 8, 2008
Posts: 108



(Msg. 5) Posted: Tue Nov 11, 2008 10:50 am
Post subject: Re: Populating a ListBox at runtime
Archived from groups: per prev. post (more info?)

In article , Kimkom wrote:
> Thank you for the reply and advice Steve.
>
> Unfortunately replacing the Set oShape line with your suggested format of:
> Set oShape = ActivePresentation.Slides(4).Shapes("ListBox1")
>
> does not populate the list. Any further advice anyone?

You also have to work out a way to trigger the code to run.

> I am also wondering if this is the correct way to go, since I don't want to
> 'AddItem' every time the PPS is run. I merely want to create the list and
> have it stay the same with each run.

Populating the listbox once manually *should* do that for you.


>
> Many thanks,
> Michael
>
> "Steve Rindsberg" wrote:
>
> > In article , Kimkom wrote:
> > > Hi All,
> > >
> > > I've been using the following code to populate a ListBox. The trouble is it
> > > doesn't populate when double-clicking the PPS file to view the slideshow. I
> > > understand why it's not populating (since it has to be run while the ListBox
> > > is selected in edit mode), just not sure how to make it work at runtime.
> > >
> > > Anyone got any pointers on how to fix it?
> >
> > Never rely on selection more than you have to, other than for your own test use
> > (as when pre-naming shapes to make something like the following easier):
> >
> > Use something like this instead:
> >
> > Set oShape = ActivePresentation.Slides(42).Shapes("Bubba")
> >
> >
> >
> > >
> > > Many thanks,
> > > Michael
> > >
> > > Sub AddItemsToSelectedListBox()
> > >
> > > Dim oShape As Shape
> > > Set oShape = ActiveWindow.Selection.ShapeRange(1)
> > >
> > > With oShape.OLEFormat.Object
> > > .Clear
> > > .AddItem ("FORMATION 01")
> > > .AddItem ("FORMATION 02")
> > > .AddItem ("FORMATION 03")
> > > .AddItem ("FORMATION 04")
> > > .AddItem ("FORMATION 05")
> > > End With
> > >
> > > End Sub
> > >
> >
> > -----------------------------------------
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: [URL="http://www.pptfaq.com"]www.pptfaq.com[/URL]
> > PPTools: [URL="http://www.pptools.com"]www.pptools.com[/URL]
> > ================================================
> >
> >
> >
>

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: [URL="http://www.pptfaq.com"]www.pptfaq.com[/URL]
PPTools: [URL="http://www.pptools.com"]www.pptools.com[/URL]
================================================
 >> Stay informed about: Populating a ListBox at runtime 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
GIF Animations: PPT 2000 vs 2003 - I have a fairly complex animated GIF file which works fine when added to a presentation using PPT 2003. It also works fine when viewed with the 2007 PPT Viewer. When viewed with PPT 2000, or added to a presentation using 2000, it shows the first few..

Automatic Viewing - Is there a way that I can make my presentation continue to play without me clicking on it. Is there an auto view set up or something.

Side-by-side of different slide presentations - I have 4 slide presentations I need to place in a matrix of sorts that would show all four, or at least two, side-by-side. Can anyone help?

help feature and Importing from Excel/Word - I am brand new to 2007 applications, but am familiar with 2003. I cannot seem to locate where the help option is in ppt 2007 and I needed to look up how to import a table from an Excel file I have into my presentation. If someone could please get me...

How do I click on a graphic and make words appear in power.. - I have a graphic in a powerpoint presentation that I need to be able to click on the graphic and have text displayed to explain a point related to the subject of the presentation. How would I be able to do this?
   Windows Help (Home) -> Microsoft Powerpoint All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]