VBA and powerpoint

  • Thread starter Thread starter Fay Yocum
  • Start date Start date
F

Fay Yocum

I bought David's book and I am trying to make something work using VBA.
There is the code

Sub AddStageI()
Dim newstuff As String

newstuff = InputBox("What is a sign of a Stage I pressure ulcer?")
If newstuff "" Then
With ActivePresentation.SlideShowWindow.View.Slide _
.Shapes(2).TextFrame.TextRange
.Text = .Text + Chr$(13) + newstuff
End With
End If

End Sub

The If newstuff line keeps redlettering me and telling me it is expecting
that it is expecting a Then or GoTo. I do have dyslexia and can't proof read
worth a darn, but I think Then = Then. Any ideas.

Thanks


Fay
 
I bought David's book and I am trying to make something work using VBA.
There is the code

Sub AddStageI()
Dim newstuff As String

newstuff = InputBox("What is a sign of a Stage I pressure ulcer?")
If newstuff "" Then

If newstuff = "" Then
' ^ Needs this
With ActivePresentation.SlideShowWindow.View.Slide _
.Shapes(2).TextFrame.TextRange
.Text = .Text + Chr$(13) + newstuff
End With
End If

End Sub

The If newstuff line keeps redlettering me and telling me it is expecting
that it is expecting a Then or GoTo. I do have dyslexia and can't proof read
worth a darn, but I think Then = Then. Any ideas.

Sometimes it barks at the wrong thing.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Thanks Fay for buying my book. Steve and TAJ are almost right. You actually
want <> (that is a less than sign followed by a greater than sign) meaing not
equal. This is a misprint in the book, and you are the first to point it
out. I am a bit annoyed because I corrected this when the publisher left it
out of one of the drafts, but it obviously didn't make it into the final copy
of the book. You are doing something based on the nature walk example on
pages 81-82. You can find the correct code for this at my Web site under
Example 6-7:

http://www.loyola.edu/education/PowerfulPowerPoint/ExamplesByChapter/Chapter6/Example06-07.txt

I'll have to contact my publisher to get this corrected in the next
printing. Sorry for the inconvenience. By the way, the only other error I
know about is on page 128, and the correct version of the code for that is
also on the Web site.

--David

David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Thanks guys. David I know about publishing books, I have written 4 and have
self-published them. But the nice part was that I had an award winning
editor that kept me honest.

I am having fun with your book. Looking forward to creating some quizzes
with it in the near future.

I like the way you present the material.

Fay
 
Thanks Fay for buying my book. Steve and TAJ are almost right. You actually
want <> (that is a less than sign followed by a greater than sign)

OK. I'm putting on the "Kick Me" shorts and bending over.

Go!

S'what I get for not reading the whole thing first.
 
Actually, the equal sign was a good idea, probably what I would have
suggested if I didn't have a little inside information.
--David

--
David M. Marcovitz, Ph.D.
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Back
Top