PC Review


Reply
Thread Tools Rate Thread

Adding Text to Slides Programmatically

 
 
=?Utf-8?B?SmltbXk=?=
Guest
Posts: n/a
 
      28th Mar 2007
I am currently within an MS Office application and I have calculated
many text items assigned to string variables in VBA.

What I want to do is wake up PowerPoint and place these text items as
bullets on a slide. I also want to be able to specify the slide title block.

Here is what I have so far. It wakes up PPT and makes a slide for me. Now,
I want to add text to this new slide:

Public Sub MakeSlide() 'from VBA window
Dim ppt As Object
Dim pptPres As Presentation
Dim pptSlide As Slide
Set ppt = New PowerPoint.Application
Set pptPres = ppt.Presentations.Add(True)
pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
Set pptSlide = pptPres.Slides.Item(1)
With pptslide
'What goes here????
' I need a title for my slide, let's call it myTitle
'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
End With

ppt.Visible = True
End Sub

Thank you in advance for you assistance.
 
Reply With Quote
 
 
 
 
David M. Marcovitz
Guest
Posts: n/a
 
      28th Mar 2007
I do something very similar to this in Example 7.8 on my site
(http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
externally; I do that from within the PowerPoint, but once you have a
slide object, it is basically the same. Note that in the slide, Shape(1)
is the title, and Shape(2) is the bulleted text area. We can be
completely confident of this because you just added the slide yourself
(if you were working from an existing slide, you would need all kinds of
error-checking to make sure it had a title area and a text area).

pptSlide.Shapes(1).TextFrame.TextRange.Text = _
"Your Title"
pptSlide.Shapes(2).TextFrame.TextRange.Text = _
"Your First Bullet Point" & Chr$(13) & _
"Your Second Bullet Point" & Chr$(13) & _
"Your Third Bullet Point & Chr$(13)


--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
news:A19FDD5A-C951-462B-B088-(E-Mail Removed):

> I am currently within an MS Office application and I have calculated
> many text items assigned to string variables in VBA.
>
> What I want to do is wake up PowerPoint and place these text items as
> bullets on a slide. I also want to be able to specify the slide title
> block.
>
> Here is what I have so far. It wakes up PPT and makes a slide for me.
> Now, I want to add text to this new slide:
>
> Public Sub MakeSlide() 'from VBA window
> Dim ppt As Object
> Dim pptPres As Presentation
> Dim pptSlide As Slide
> Set ppt = New PowerPoint.Application
> Set pptPres = ppt.Presentations.Add(True)
> pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
> Set pptSlide = pptPres.Slides.Item(1)
> With pptslide
> 'What goes here????
> ' I need a title for my slide, let's call it myTitle
> 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
> End With
>
> ppt.Visible = True
> End Sub
>
> Thank you in advance for you assistance.
>


 
Reply With Quote
 
=?Utf-8?B?SmltbXk=?=
Guest
Posts: n/a
 
      28th Mar 2007
Thank you. Your link was also most helpful.
The only change I made to the code you posted above was to close the quote
after "Your Third Bullet Pont" << & Char$(13)

Perfect!

"David M. Marcovitz" wrote:

> I do something very similar to this in Example 7.8 on my site
> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
> externally; I do that from within the PowerPoint, but once you have a
> slide object, it is basically the same. Note that in the slide, Shape(1)
> is the title, and Shape(2) is the bulleted text area. We can be
> completely confident of this because you just added the slide yourself
> (if you were working from an existing slide, you would need all kinds of
> error-checking to make sure it had a title area and a text area).
>
> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
> "Your Title"
> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
> "Your First Bullet Point" & Chr$(13) & _
> "Your Second Bullet Point" & Chr$(13) & _
> "Your Third Bullet Point & Chr$(13)
>
>
> --
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Director of Graduate Programs in Educational Technology
> Loyola College in Maryland
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
>
> > I am currently within an MS Office application and I have calculated
> > many text items assigned to string variables in VBA.
> >
> > What I want to do is wake up PowerPoint and place these text items as
> > bullets on a slide. I also want to be able to specify the slide title
> > block.
> >
> > Here is what I have so far. It wakes up PPT and makes a slide for me.
> > Now, I want to add text to this new slide:
> >
> > Public Sub MakeSlide() 'from VBA window
> > Dim ppt As Object
> > Dim pptPres As Presentation
> > Dim pptSlide As Slide
> > Set ppt = New PowerPoint.Application
> > Set pptPres = ppt.Presentations.Add(True)
> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
> > Set pptSlide = pptPres.Slides.Item(1)
> > With pptslide
> > 'What goes here????
> > ' I need a title for my slide, let's call it myTitle
> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
> > End With
> >
> > ppt.Visible = True
> > End Sub
> >
> > Thank you in advance for you assistance.
> >

>
>

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      28th Mar 2007
Great. I'm glad it helped. That'll teach me to edit in the newsreader.
I'm glad you caught the missing close quote.
--David

=?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):

> Thank you. Your link was also most helpful.
> The only change I made to the code you posted above was to close the
> quote after "Your Third Bullet Pont" << & Char$(13)
>
> Perfect!
>
> "David M. Marcovitz" wrote:
>
>> I do something very similar to this in Example 7.8 on my site
>> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
>> externally; I do that from within the PowerPoint, but once you have a
>> slide object, it is basically the same. Note that in the slide,
>> Shape(1) is the title, and Shape(2) is the bulleted text area. We can
>> be completely confident of this because you just added the slide
>> yourself (if you were working from an existing slide, you would need
>> all kinds of error-checking to make sure it had a title area and a
>> text area).
>>
>> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
>> "Your Title"
>> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
>> "Your First Bullet Point" & Chr$(13) & _
>> "Your Second Bullet Point" & Chr$(13) & _
>> "Your Third Bullet Point & Chr$(13)
>>
>>
>> --
>> David M. Marcovitz
>> Microsoft PowerPoint MVP
>> Director of Graduate Programs in Educational Technology
>> Loyola College in Maryland
>> Author of _Powerful PowerPoint for Educators_
>> http://www.PowerfulPowerPoint.com/
>>
>> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
>> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
>>
>> > I am currently within an MS Office application and I have
>> > calculated many text items assigned to string variables in VBA.
>> >
>> > What I want to do is wake up PowerPoint and place these text items
>> > as bullets on a slide. I also want to be able to specify the slide
>> > title block.
>> >
>> > Here is what I have so far. It wakes up PPT and makes a slide for
>> > me.
>> > Now, I want to add text to this new slide:
>> >
>> > Public Sub MakeSlide() 'from VBA window
>> > Dim ppt As Object
>> > Dim pptPres As Presentation
>> > Dim pptSlide As Slide
>> > Set ppt = New PowerPoint.Application
>> > Set pptPres = ppt.Presentations.Add(True)
>> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
>> > Set pptSlide = pptPres.Slides.Item(1)
>> > With pptslide
>> > 'What goes here????
>> > ' I need a title for my slide, let's call it myTitle
>> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
>> > End With
>> >
>> > ppt.Visible = True
>> > End Sub
>> >
>> > Thank you in advance for you assistance.
>> >

>>
>>

>


 
Reply With Quote
 
=?Utf-8?B?SmVmZiBILg==?=
Guest
Posts: n/a
 
      6th Nov 2007
Adding the bullets is great, but the problem I am having is that I can't
indent the second bullet to be a sub bullet.

Thanks
Jeff

"David M. Marcovitz" wrote:

> Great. I'm glad it helped. That'll teach me to edit in the newsreader.
> I'm glad you caught the missing close quote.
> --David
>
> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):
>
> > Thank you. Your link was also most helpful.
> > The only change I made to the code you posted above was to close the
> > quote after "Your Third Bullet Pont" << & Char$(13)
> >
> > Perfect!
> >
> > "David M. Marcovitz" wrote:
> >
> >> I do something very similar to this in Example 7.8 on my site
> >> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
> >> externally; I do that from within the PowerPoint, but once you have a
> >> slide object, it is basically the same. Note that in the slide,
> >> Shape(1) is the title, and Shape(2) is the bulleted text area. We can
> >> be completely confident of this because you just added the slide
> >> yourself (if you were working from an existing slide, you would need
> >> all kinds of error-checking to make sure it had a title area and a
> >> text area).
> >>
> >> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
> >> "Your Title"
> >> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
> >> "Your First Bullet Point" & Chr$(13) & _
> >> "Your Second Bullet Point" & Chr$(13) & _
> >> "Your Third Bullet Point & Chr$(13)
> >>
> >>
> >> --
> >> David M. Marcovitz
> >> Microsoft PowerPoint MVP
> >> Director of Graduate Programs in Educational Technology
> >> Loyola College in Maryland
> >> Author of _Powerful PowerPoint for Educators_
> >> http://www.PowerfulPowerPoint.com/
> >>
> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> >> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
> >>
> >> > I am currently within an MS Office application and I have
> >> > calculated many text items assigned to string variables in VBA.
> >> >
> >> > What I want to do is wake up PowerPoint and place these text items
> >> > as bullets on a slide. I also want to be able to specify the slide
> >> > title block.
> >> >
> >> > Here is what I have so far. It wakes up PPT and makes a slide for
> >> > me.
> >> > Now, I want to add text to this new slide:
> >> >
> >> > Public Sub MakeSlide() 'from VBA window
> >> > Dim ppt As Object
> >> > Dim pptPres As Presentation
> >> > Dim pptSlide As Slide
> >> > Set ppt = New PowerPoint.Application
> >> > Set pptPres = ppt.Presentations.Add(True)
> >> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
> >> > Set pptSlide = pptPres.Slides.Item(1)
> >> > With pptslide
> >> > 'What goes here????
> >> > ' I need a title for my slide, let's call it myTitle
> >> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
> >> > End With
> >> >
> >> > ppt.Visible = True
> >> > End Sub
> >> >
> >> > Thank you in advance for you assistance.
> >> >
> >>
> >>

> >

>
>

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      6th Nov 2007
pptSlide.Shapes(2).TextFrame.TextRange.Paragraphs(2).IndentLevel = 2

How's that?

--David
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?SmVmZiBILg==?= <Jeff H.@discussions.microsoft.com> wrote in
news:7F9FEC8A-6871-4FFA-9C99-(E-Mail Removed):

> Adding the bullets is great, but the problem I am having is that I

can't
> indent the second bullet to be a sub bullet.
>
> Thanks
> Jeff
>
> "David M. Marcovitz" wrote:
>
>> Great. I'm glad it helped. That'll teach me to edit in the newsreader.
>> I'm glad you caught the missing close quote.
>> --David
>>
>> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
>> news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):
>>
>> > Thank you. Your link was also most helpful.
>> > The only change I made to the code you posted above was to close the
>> > quote after "Your Third Bullet Pont" << & Char$(13)
>> >
>> > Perfect!
>> >
>> > "David M. Marcovitz" wrote:
>> >
>> >> I do something very similar to this in Example 7.8 on my site
>> >> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
>> >> externally; I do that from within the PowerPoint, but once you have

a
>> >> slide object, it is basically the same. Note that in the slide,
>> >> Shape(1) is the title, and Shape(2) is the bulleted text area. We

can
>> >> be completely confident of this because you just added the slide
>> >> yourself (if you were working from an existing slide, you would

need
>> >> all kinds of error-checking to make sure it had a title area and a
>> >> text area).
>> >>
>> >> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
>> >> "Your Title"
>> >> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
>> >> "Your First Bullet Point" & Chr$(13) & _
>> >> "Your Second Bullet Point" & Chr$(13) & _
>> >> "Your Third Bullet Point & Chr$(13)
>> >>
>> >>
>> >> --
>> >> David M. Marcovitz
>> >> Microsoft PowerPoint MVP
>> >> Director of Graduate Programs in Educational Technology
>> >> Loyola College in Maryland
>> >> Author of _Powerful PowerPoint for Educators_
>> >> http://www.PowerfulPowerPoint.com/
>> >>
>> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
>> >> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
>> >>
>> >> > I am currently within an MS Office application and I have
>> >> > calculated many text items assigned to string variables in VBA.
>> >> >
>> >> > What I want to do is wake up PowerPoint and place these text

items
>> >> > as bullets on a slide. I also want to be able to specify the

slide
>> >> > title block.
>> >> >
>> >> > Here is what I have so far. It wakes up PPT and makes a slide

for
>> >> > me.
>> >> > Now, I want to add text to this new slide:
>> >> >
>> >> > Public Sub MakeSlide() 'from VBA window
>> >> > Dim ppt As Object
>> >> > Dim pptPres As Presentation
>> >> > Dim pptSlide As Slide
>> >> > Set ppt = New PowerPoint.Application
>> >> > Set pptPres = ppt.Presentations.Add(True)
>> >> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
>> >> > Set pptSlide = pptPres.Slides.Item(1)
>> >> > With pptslide
>> >> > 'What goes here????
>> >> > ' I need a title for my slide, let's call it myTitle
>> >> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
>> >> > End With
>> >> >
>> >> > ppt.Visible = True
>> >> > End Sub
>> >> >
>> >> > Thank you in advance for you assistance.
>> >> >
>> >>
>> >>
>> >

>>
>>

>


 
Reply With Quote
 
=?Utf-8?B?SmVmZiBILg==?=
Guest
Posts: n/a
 
      6th Nov 2007
It works great but everything after my first bullet is indented. I'll get my
logic straightened out and everything should be ok.

Thanks for the help.

Jeff

"David M. Marcovitz" wrote:

> pptSlide.Shapes(2).TextFrame.TextRange.Paragraphs(2).IndentLevel = 2
>
> How's that?
>
> --David
> --
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Director of Graduate Programs in Educational Technology
> Loyola College in Maryland
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> =?Utf-8?B?SmVmZiBILg==?= <Jeff H.@discussions.microsoft.com> wrote in
> news:7F9FEC8A-6871-4FFA-9C99-(E-Mail Removed):
>
> > Adding the bullets is great, but the problem I am having is that I

> can't
> > indent the second bullet to be a sub bullet.
> >
> > Thanks
> > Jeff
> >
> > "David M. Marcovitz" wrote:
> >
> >> Great. I'm glad it helped. That'll teach me to edit in the newsreader.
> >> I'm glad you caught the missing close quote.
> >> --David
> >>
> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> >> news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):
> >>
> >> > Thank you. Your link was also most helpful.
> >> > The only change I made to the code you posted above was to close the
> >> > quote after "Your Third Bullet Pont" << & Char$(13)
> >> >
> >> > Perfect!
> >> >
> >> > "David M. Marcovitz" wrote:
> >> >
> >> >> I do something very similar to this in Example 7.8 on my site
> >> >> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
> >> >> externally; I do that from within the PowerPoint, but once you have

> a
> >> >> slide object, it is basically the same. Note that in the slide,
> >> >> Shape(1) is the title, and Shape(2) is the bulleted text area. We

> can
> >> >> be completely confident of this because you just added the slide
> >> >> yourself (if you were working from an existing slide, you would

> need
> >> >> all kinds of error-checking to make sure it had a title area and a
> >> >> text area).
> >> >>
> >> >> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
> >> >> "Your Title"
> >> >> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
> >> >> "Your First Bullet Point" & Chr$(13) & _
> >> >> "Your Second Bullet Point" & Chr$(13) & _
> >> >> "Your Third Bullet Point & Chr$(13)
> >> >>
> >> >>
> >> >> --
> >> >> David M. Marcovitz
> >> >> Microsoft PowerPoint MVP
> >> >> Director of Graduate Programs in Educational Technology
> >> >> Loyola College in Maryland
> >> >> Author of _Powerful PowerPoint for Educators_
> >> >> http://www.PowerfulPowerPoint.com/
> >> >>
> >> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> >> >> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
> >> >>
> >> >> > I am currently within an MS Office application and I have
> >> >> > calculated many text items assigned to string variables in VBA.
> >> >> >
> >> >> > What I want to do is wake up PowerPoint and place these text

> items
> >> >> > as bullets on a slide. I also want to be able to specify the

> slide
> >> >> > title block.
> >> >> >
> >> >> > Here is what I have so far. It wakes up PPT and makes a slide

> for
> >> >> > me.
> >> >> > Now, I want to add text to this new slide:
> >> >> >
> >> >> > Public Sub MakeSlide() 'from VBA window
> >> >> > Dim ppt As Object
> >> >> > Dim pptPres As Presentation
> >> >> > Dim pptSlide As Slide
> >> >> > Set ppt = New PowerPoint.Application
> >> >> > Set pptPres = ppt.Presentations.Add(True)
> >> >> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
> >> >> > Set pptSlide = pptPres.Slides.Item(1)
> >> >> > With pptslide
> >> >> > 'What goes here????
> >> >> > ' I need a title for my slide, let's call it myTitle
> >> >> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
> >> >> > End With
> >> >> >
> >> >> > ppt.Visible = True
> >> >> > End Sub
> >> >> >
> >> >> > Thank you in advance for you assistance.
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >>

> >

>
>

 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgTS4gTWFyY292aXR6?=
Guest
Posts: n/a
 
      7th Nov 2007
If you put that line AFTER the line that puts the third line of text in,
instead of right after the line that puts the second line of text in, it
should just indent the second line. That is, if there are already 3 lines,
and you indent line 2, just line 2 is indented. But if there are only 2
lines, and you indent line 2, then line 2 and any future lines will be
indented.
--David

David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

"Jeff H." wrote:

> It works great but everything after my first bullet is indented. I'll get my
> logic straightened out and everything should be ok.
>
> Thanks for the help.
>
> Jeff
>
> "David M. Marcovitz" wrote:
>
> > pptSlide.Shapes(2).TextFrame.TextRange.Paragraphs(2).IndentLevel = 2
> >
> > How's that?
> >
> > --David
> > --
> > David M. Marcovitz
> > Microsoft PowerPoint MVP
> > Director of Graduate Programs in Educational Technology
> > Loyola College in Maryland
> > Author of _Powerful PowerPoint for Educators_
> > http://www.PowerfulPowerPoint.com/
> >
> > =?Utf-8?B?SmVmZiBILg==?= <Jeff H.@discussions.microsoft.com> wrote in
> > news:7F9FEC8A-6871-4FFA-9C99-(E-Mail Removed):
> >
> > > Adding the bullets is great, but the problem I am having is that I

> > can't
> > > indent the second bullet to be a sub bullet.
> > >
> > > Thanks
> > > Jeff
> > >
> > > "David M. Marcovitz" wrote:
> > >
> > >> Great. I'm glad it helped. That'll teach me to edit in the newsreader.
> > >> I'm glad you caught the missing close quote.
> > >> --David
> > >>
> > >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> > >> news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):
> > >>
> > >> > Thank you. Your link was also most helpful.
> > >> > The only change I made to the code you posted above was to close the
> > >> > quote after "Your Third Bullet Pont" << & Char$(13)
> > >> >
> > >> > Perfect!
> > >> >
> > >> > "David M. Marcovitz" wrote:
> > >> >
> > >> >> I do something very similar to this in Example 7.8 on my site
> > >> >> (http://www.PowerfulPowerPoint.com). I don't access the PowerPoint
> > >> >> externally; I do that from within the PowerPoint, but once you have

> > a
> > >> >> slide object, it is basically the same. Note that in the slide,
> > >> >> Shape(1) is the title, and Shape(2) is the bulleted text area. We

> > can
> > >> >> be completely confident of this because you just added the slide
> > >> >> yourself (if you were working from an existing slide, you would

> > need
> > >> >> all kinds of error-checking to make sure it had a title area and a
> > >> >> text area).
> > >> >>
> > >> >> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
> > >> >> "Your Title"
> > >> >> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
> > >> >> "Your First Bullet Point" & Chr$(13) & _
> > >> >> "Your Second Bullet Point" & Chr$(13) & _
> > >> >> "Your Third Bullet Point & Chr$(13)
> > >> >>
> > >> >>
> > >> >> --
> > >> >> David M. Marcovitz
> > >> >> Microsoft PowerPoint MVP
> > >> >> Director of Graduate Programs in Educational Technology
> > >> >> Loyola College in Maryland
> > >> >> Author of _Powerful PowerPoint for Educators_
> > >> >> http://www.PowerfulPowerPoint.com/
> > >> >>
> > >> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
> > >> >> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
> > >> >>
> > >> >> > I am currently within an MS Office application and I have
> > >> >> > calculated many text items assigned to string variables in VBA.
> > >> >> >
> > >> >> > What I want to do is wake up PowerPoint and place these text

> > items
> > >> >> > as bullets on a slide. I also want to be able to specify the

> > slide
> > >> >> > title block.
> > >> >> >
> > >> >> > Here is what I have so far. It wakes up PPT and makes a slide

> > for
> > >> >> > me.
> > >> >> > Now, I want to add text to this new slide:
> > >> >> >
> > >> >> > Public Sub MakeSlide() 'from VBA window
> > >> >> > Dim ppt As Object
> > >> >> > Dim pptPres As Presentation
> > >> >> > Dim pptSlide As Slide
> > >> >> > Set ppt = New PowerPoint.Application
> > >> >> > Set pptPres = ppt.Presentations.Add(True)
> > >> >> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
> > >> >> > Set pptSlide = pptPres.Slides.Item(1)
> > >> >> > With pptslide
> > >> >> > 'What goes here????
> > >> >> > ' I need a title for my slide, let's call it myTitle
> > >> >> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
> > >> >> > End With
> > >> >> >
> > >> >> > ppt.Visible = True
> > >> >> > End Sub
> > >> >> >
> > >> >> > Thank you in advance for you assistance.
> > >> >> >
> > >> >>
> > >> >>
> > >> >
> > >>
> > >>
> > >

> >
> >

 
Reply With Quote
 
Echo S
Guest
Posts: n/a
 
      7th Nov 2007
And "I don't know" is on third! 8-|

lol

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/power...noy/index.html

"David M. Marcovitz" <(E-Mail Removed)> wrote in
message news:6C7C1803-651E-4164-A564-(E-Mail Removed)...
> If you put that line AFTER the line that puts the third line of text in,
> instead of right after the line that puts the second line of text in, it
> should just indent the second line. That is, if there are already 3 lines,
> and you indent line 2, just line 2 is indented. But if there are only 2
> lines, and you indent line 2, then line 2 and any future lines will be
> indented.
> --David
>
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Director of Graduate Programs in Educational Technology
> Loyola College in Maryland
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> "Jeff H." wrote:
>
>> It works great but everything after my first bullet is indented. I'll
>> get my
>> logic straightened out and everything should be ok.
>>
>> Thanks for the help.
>>
>> Jeff
>>
>> "David M. Marcovitz" wrote:
>>
>> > pptSlide.Shapes(2).TextFrame.TextRange.Paragraphs(2).IndentLevel = 2
>> >
>> > How's that?
>> >
>> > --David
>> > --
>> > David M. Marcovitz
>> > Microsoft PowerPoint MVP
>> > Director of Graduate Programs in Educational Technology
>> > Loyola College in Maryland
>> > Author of _Powerful PowerPoint for Educators_
>> > http://www.PowerfulPowerPoint.com/
>> >
>> > =?Utf-8?B?SmVmZiBILg==?= <Jeff H.@discussions.microsoft.com> wrote in
>> > news:7F9FEC8A-6871-4FFA-9C99-(E-Mail Removed):
>> >
>> > > Adding the bullets is great, but the problem I am having is that I
>> > can't
>> > > indent the second bullet to be a sub bullet.
>> > >
>> > > Thanks
>> > > Jeff
>> > >
>> > > "David M. Marcovitz" wrote:
>> > >
>> > >> Great. I'm glad it helped. That'll teach me to edit in the
>> > >> newsreader.
>> > >> I'm glad you caught the missing close quote.
>> > >> --David
>> > >>
>> > >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
>> > >> news:E736A278-AE5C-4026-A8D1-(E-Mail Removed):
>> > >>
>> > >> > Thank you. Your link was also most helpful.
>> > >> > The only change I made to the code you posted above was to close
>> > >> > the
>> > >> > quote after "Your Third Bullet Pont" << & Char$(13)
>> > >> >
>> > >> > Perfect!
>> > >> >
>> > >> > "David M. Marcovitz" wrote:
>> > >> >
>> > >> >> I do something very similar to this in Example 7.8 on my site
>> > >> >> (http://www.PowerfulPowerPoint.com). I don't access the
>> > >> >> PowerPoint
>> > >> >> externally; I do that from within the PowerPoint, but once you
>> > >> >> have
>> > a
>> > >> >> slide object, it is basically the same. Note that in the slide,
>> > >> >> Shape(1) is the title, and Shape(2) is the bulleted text area. We
>> > can
>> > >> >> be completely confident of this because you just added the slide
>> > >> >> yourself (if you were working from an existing slide, you would
>> > need
>> > >> >> all kinds of error-checking to make sure it had a title area and
>> > >> >> a
>> > >> >> text area).
>> > >> >>
>> > >> >> pptSlide.Shapes(1).TextFrame.TextRange.Text = _
>> > >> >> "Your Title"
>> > >> >> pptSlide.Shapes(2).TextFrame.TextRange.Text = _
>> > >> >> "Your First Bullet Point" & Chr$(13) & _
>> > >> >> "Your Second Bullet Point" & Chr$(13) & _
>> > >> >> "Your Third Bullet Point & Chr$(13)
>> > >> >>
>> > >> >>
>> > >> >> --
>> > >> >> David M. Marcovitz
>> > >> >> Microsoft PowerPoint MVP
>> > >> >> Director of Graduate Programs in Educational Technology
>> > >> >> Loyola College in Maryland
>> > >> >> Author of _Powerful PowerPoint for Educators_
>> > >> >> http://www.PowerfulPowerPoint.com/
>> > >> >>
>> > >> >> =?Utf-8?B?SmltbXk=?= <(E-Mail Removed)> wrote in
>> > >> >> news:A19FDD5A-C951-462B-B088-(E-Mail Removed):
>> > >> >>
>> > >> >> > I am currently within an MS Office application and I have
>> > >> >> > calculated many text items assigned to string variables in VBA.
>> > >> >> >
>> > >> >> > What I want to do is wake up PowerPoint and place these text
>> > items
>> > >> >> > as bullets on a slide. I also want to be able to specify the
>> > slide
>> > >> >> > title block.
>> > >> >> >
>> > >> >> > Here is what I have so far. It wakes up PPT and makes a slide
>> > for
>> > >> >> > me.
>> > >> >> > Now, I want to add text to this new slide:
>> > >> >> >
>> > >> >> > Public Sub MakeSlide() 'from VBA window
>> > >> >> > Dim ppt As Object
>> > >> >> > Dim pptPres As Presentation
>> > >> >> > Dim pptSlide As Slide
>> > >> >> > Set ppt = New PowerPoint.Application
>> > >> >> > Set pptPres = ppt.Presentations.Add(True)
>> > >> >> > pptPres.Slides.Add 1, ppLayoutText 'Adds slide #1
>> > >> >> > Set pptSlide = pptPres.Slides.Item(1)
>> > >> >> > With pptslide
>> > >> >> > 'What goes here????
>> > >> >> > ' I need a title for my slide, let's call it myTitle
>> > >> >> > 'I need to add bullets: Bullet1, Bullet2, Bullet3, etc.
>> > >> >> > End With
>> > >> >> >
>> > >> >> > ppt.Visible = True
>> > >> >> > End Sub
>> > >> >> >
>> > >> >> > Thank you in advance for you assistance.
>> > >> >> >
>> > >> >>
>> > >> >>
>> > >> >
>> > >>
>> > >>
>> > >
>> >
>> >


 
Reply With Quote
 
Brian Reilly, MVP
Guest
Posts: n/a
 
      8th Nov 2007
Echo,
"I don't know" is still in the batter's box. Not even on first.

All others, come here to the PPT Newsgroup and not only get on first,
second or third, but you can touch home plate and score.

Couldn't resist,

Brian Reilly, MVP


On Wed, 7 Nov 2007 17:31:42 -0500, "Echo S"
<(E-Mail Removed)> wrote:

>And "I don't know" is on third! 8-|
>
>lol

 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Repeating text to photo slides =?Utf-8?B?SlRX?= Microsoft Powerpoint 10 31st Jan 2006 04:20 PM
adding text to multiple slides ponderguy Microsoft Powerpoint 2 1st Apr 2005 05:43 AM
Adding text\stamping text across slides e.g. CONFIDENTIAL =?Utf-8?B?TWFuaQ==?= Microsoft Powerpoint 1 2nd Mar 2005 06:15 PM
Adding text to slides or movie =?Utf-8?B?TGFiIFN0dWRlbnQ=?= Windows XP MovieMaker 4 3rd Nov 2004 07:35 PM
Re: adding a text box to a report programmatically? Duane Hookom Microsoft Access Reports 0 10th Sep 2003 06:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:54 AM.