PDA

View Full Version : Building a Ticker



kraves
07-26-2007, 05:00 AM
Hi, I've been been trying to make a Ticker equivalent in powerpoint.
A single slide that loops once the ticker crawls by, updating ticker contents from a single line textfile.

I started with a textbox, got it working fine, except it will always wordwrap at around 67 characters even with wordwrap false. Here's a code snippet
I was trying lots of tags to try and get past this.

Sub UpdateTickerText()
Dim oShp, oNewShp As Shape
Dim Temp
Dim InputBuffer As String
Dim FileNum As Integer
FileNum = FreeFile
'Select Shape with Ticker Text
Set oShp = ActiveWindow.Selection.SlideRange.Shapes("Text Box 10")
If Not TickerFileName <> "" Then SelectTickerTextFile
If Dir$(TickerFileName) <> "" Then ' file exists, continue
Open TickerFileName For Input As FileNum
While Not EOF(FileNum)
Input #FileNum, InputBuffer
' Do whatever you need to with the contents of InputBuffer
MsgBox (InputBuffer)
Temp = oShp.Left
With oShp.TextFrame
'.DeleteText
.TextRange.Text = InputBuffer
.WordWrap = msoFalse
.TextRange.Font.Name = TickerFont
.TextRange.Font.Size = TickerSize
.TextRange.ChangeCase (ppCaseUpper)
.AutoSize = ppAutoSizeNone
.VerticalAnchor = msoAnchorMiddle
.HorizontalAnchor = msoAnchorNone
.TextRange.ParagraphFormat.Alignment = ppAlignLeft
.TextRange.ParagraphFormat.WordWrap = msoFalse
End With
Wend
Close FileNum
End If
End Sub

Any Ideas to solve this one? Am I missing a tag somewhere?

So I moved on to use wordart which is basically working fine until I hit a 199/200 char limit. I'm guessing this is the max length of wordart text.
Here's a snippet:


'Create new Ticker using wordart object
Set oShp = ActiveWindow.Selection.SlideRange.Shapes.AddTextEffect _
(PresetTextEffect:=msoTextEffect1, Text:=InputBuffer, FontName:=TickerFont, _
FontSize:=TickerSize, FontBold:=msoFalse, FontItalic:=msoFalse, _
Left:=TickerLeft, Top:=TickerTop)

Any ideas on getting around the 200 limit?
My only thought is to create multiple wordarts end to end, group them, then aniumate the group.
Alternatively has anyone coded a similar routine and willing to share?


cheers, kraves