Need Help Creating Auto Run CD with Windows Media Player Video Obj

G

Guest

First of all thanks ahead of time for any help! I'm trying to find the best
way, or best product, to create an auto run CD of a presentation that has
windows media player objects running the .avi files. We are using the Player
because we needed control to pause and alter volume, etc. in the presentation.

Am I correct in assuming the 2003 viewer does not do this? I will try the
DYI options on echosvoice.com but don't want to recreate the wheel. I would
imagine the end user would probably need PowerPoint/Windows Media Player
installed, which is not a problem.

And in general I'd like to gripe that PowerPoint does not allow highlighting
in text! My friends and family miss me while I'm busy making countless yellow
rectangular boxes.

Thanks!
DQuint
 
S

Steve Rindsberg

And in general I'd like to gripe that PowerPoint does not allow highlighting
in text! My friends and family miss me while I'm busy making countless yellow
rectangular boxes.

I guess they'll have to get used to having you hanging around the place again,
then. Here's a macro that'll automate the job:

Highlight text in PowerPoint
http://www.rdpslides.com/pptfaq/FAQ00776.htm
 
G

Guest

Thanks! I used the toolbar add-in code with the highlighting code and picked
some new Face ID icons and that did the trick :) It throws an error if no
text is selected and you click the button but maybe I can fix that eventually
too :) Here is what worked:

Sub Auto_Open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
Dim MyToolbar As String

' Give the toolbar a name
MyToolbar = "HLite"

On Error Resume Next
' so that it doesn't stop on the next line if the toolbar's already there

' Create the toolbar; PowerPoint will error if it already exists
Set oToolbar = CommandBars.Add(Name:=MyToolbar, _
Position:=msoBarFloating, Temporary:=True)
If Err.Number <> 0 Then
' The toolbar's already there, so we have nothing to do
Exit Sub
End If

On Error GoTo ErrorHandler

' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)

' And set some of the button's properties
With oButton
.DescriptionText = "Highlight Text"
'Tooltip text when mouse if placed over button
.Caption = "Highlight Text"
'Text if Text in Icon is chosen
.OnAction = "Button1"
'Runs the Sub Button1() code when clicked
.Style = msoButtonIcon
' Button displays as icon, not text or both
.FaceId = 1715
' chooses icon #1715 from the available Office icons
End With

' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)

' And set some of the button's properties
With oButton
.DescriptionText = "Unhighlight Text"
'Tooltip text when mouse if placed over button
.Caption = "Unhighlight Text"
'Text if Text in Icon is chosen
.OnAction = "Button2"
'Runs the Sub Button2() code when clicked
.Style = msoButtonIcon
' Button displays as icon, not text or both
.FaceId = 1716
' chooses icon #1716 from the available Office icons
End With

' Repeat the above for as many more buttons as you need to add
' Be sure to change the .OnAction property at least for each new button

' You can set the toolbar position and visibility here if you like
' By default, it'll be visible when created
oToolbar.Top = 150
oToolbar.Left = 150
oToolbar.Visible = True

NormalExit:
Exit Sub ' so it doesn't go on to run the errorhandler code

ErrorHandler:
'Just in case there is an error
MsgBox Err.Number & vbCrLf & Err.Description
Resume NormalExit:
End Sub


Sub Button1()

Dim oRng As TextRange
Dim lLineCount As Long
Dim oRect As Shape
Dim dOffset As Double
Dim lFillColor As Long

' EDIT THESE AS NEEDED
' dOffset sets the amount of padding added around the text (in points)
dOffset = 2
' change this to get a different highlight color
lFillColor = RGB(255, 255, 128)

With ActiveWindow.Selection.TextRange
For lLineCount = 1 To .Lines.Count
Set oRng = .Lines(lLineCount)
With oRng
Set oRect =
ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRectangle, _
.BoundLeft - dOffset, _
.BoundTop - dOffset, _
.BoundWidth + dOffset, _
.BoundHeight + dOffset)
With oRect
' format it
.Fill.ForeColor.RGB = lFillColor
.Line.Visible = msoFalse
' tag it so we can find/delete it later
Call .Tags.Add("Highlight", "YES")
' send it behind the text
While Not .ZOrderPosition <
ActiveWindow.Selection.ShapeRange(1).ZOrderPosition
.ZOrder msoSendBackward
Wend
End With
End With
Next
End With

End Sub


Sub Button2()

' Removes highlights

Dim oSh As Shape
Dim x As Long

With ActiveWindow.Selection.SlideRange(1)
For x = .Shapes.Count To 1 Step -1
Set oSh = .Shapes(x)
If oSh.Tags("Highlight") = "YES" Then
oSh.Delete
End If
Next
End With

End Sub
 
S

Steve Rindsberg

Thanks! I used the toolbar add-in code with the highlighting code and picked
some new Face ID icons and that did the trick :) It throws an error if no
text is selected and you click the button but maybe I can fix that eventually
too :)

Sure ya can. Try adding this function to your code:

Function SelectionIsText() as Boolean
if ActiveWindow.Selection.Type = ppSelectionText Then
SelectionIsText = True
Else
SelectionIsText = False
end if
End Function

Then surround the highlighting code with:

If SelectionIsText Then
' Do yer stuff
Else
MsgBox("Silly PowerPointer ... you have to SELECT the text before you can
highlight it!")
End If

Here is what worked:
 
G

Guest

Thank you! Thank you! You are awesome! (as they say in Massachusetts)
I did get this working for new PowerPoint files however when I open
pre-existing files the highlight function doesn't work. Any ideas why?
 
G

Guest

Unfortunately I only have a CD burner and my main goal is to keep the Windows
Media Controls for rewind, fast forward, pause, etc. intact and have the file
launch in presentation mode. I tried the demo and the .ppt with the videos
failed...could be my computer though. A ppt without videos did run though.
 
G

Guest

Sorry, a little more info :) Some files when I insert the highlight it adds a
clear box with no fill? Maybe something to do with color schemes? I can't
find the culprit.
 
S

Steve Rindsberg

Sorry, a little more info :) Some files when I insert the highlight it adds a
clear box with no fill? Maybe something to do with color schemes? I can't
find the culprit.

The color scheme shouldn't have any effect since we're not setting the highlight rectangle
fill to a scheme color.

Did you save the code as an addin and install it using Tools, Addins, by the way?
 
G

Guest

Yes, I saved the .ppt as a .ppa file and added it in. Only some files don't
add the correct highlight color, and when I cut and paste those slides into a
new presentation the highlighting works properly (which is what I will do for
my new template if I can't figure out why the old one doesn't work).

Thanks!
 
S

Steve Rindsberg

Yes, I saved the .ppt as a .ppa file and added it in. Only some files don't
add the correct highlight color, and when I cut and paste those slides into a
new presentation the highlighting works properly (which is what I will do for
my new template if I can't figure out why the old one doesn't work).

What happens if you run the code from a PPT file rather than as an addin and you step through
the code line by line while also watching the slide? Does the same thing happen?

If so, shoot me a one-slide example presentation ... email to steve at-sign pptools dot com
(and remind me in the body of the email what it's about)
 
S

Steve Rindsberg

Bingo ... got the sample file and found the problem. See below ...

I've updated the FAQ with this correction too.

Thanks!

The default fill for these presentations was set to False, so unless we explicitly set it as
visible, it won't be. So all it takes is adding this, here:

.Fill.Visible = msoTrue


... and so on
 
G

Guest

That's it :) I'm still looking for the Windows Media Player stuff but might
post it separate since I goofed and tried for two for one :) Thanks again for
all your help!!!!!!!
 
S

Steve Rindsberg

That's it :) I'm still looking for the Windows Media Player stuff but might
post it separate since I goofed and tried for two for one :) Thanks again for
all your help!!!!!!!

Austin's the WMP (note carefully: no "I" in there. none. he's much bigger than me) expert.
 
A

Austin Myers

There really is no reason to use the Windows Media Player. You can create a
set of buttons for play, pause, stop. To do so insert a video and in
"Custom Animation" click "Add Effect" at the bottom of the list you will see
"Movie Actions" and then the controls you want.

The actions may be assigned to the video itself so that clicking it results
in the desired action, or you can make buttons (any object) and use them as
"triggers".

The advantage in NOT using the Windows Media Player is the resulting
presentation will work in the PowerPoint viewers (WMP will not.) Also, if
the presentation is to be distributed you don't need to worry about the
client having an uptodate install of WMP.


Austin Myers
MS PowerPoint MVP Team

PowerPoint Video and PowerPoint Sound Solutions www.pfcmedia.com
 
A

Andy Webb

Does anyone know if there is a settings file for PowerPoint.

Every time I leave PowerPoint it comes up with an error.

As far as I can see it's not writing any new settings to disk,
so every time I open it I get such things as old files listed in
the recent file list and old menu arrangements, so something
is not being saved.

This is on PowerPoint 2003 for Windows.

If there is a settings file can anyone point me to it's location.

Many thanks.

Andy
 
A

Andy Webb

Sorry somehow my post got into this subject instead of
it being a new post.

My fault

Andy
 
G

Guest

Thanks, I will let the users know of the limitations using the Windows Media
Player Object and will fool around with the animation effects...it is
preferable to have a pre-made bar with a slider, volume and controls (we use
it for trial presentations) especially when inserting many videos. What we
will probably end up doing is keeping it in the presentations then making a
separate version for CD. Once you give them the full functionality its hard
to take it away :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top