A
Anirahu
from VB6, I open a PPT presentation. That's all fine. when I attempt to use
the addtextbox method I get this error. Other postings on this subject do not
solve my problem. I am using a licensed version Office 2003. I even
reinstalled it to repair files. This error usually happens if a dll is not
registered. However, since I've installed it twice...
Here's simple code. Note: error is on line with !!!! to the left.
Set AppPPT = CreateObject("PowerPoint.Application")
AppPPT.Visible = True
' If you want to hide the PowerPoint Window, set the visible property
' to FALSE and WithWindow argument of Open method to FALSE too.
AppPPT.Presentations.Open ("D:\Data\VBcode\VBPPT\sample.ppt")
With AppPPT.Presentations
' .Add WithWindow:=msoTrue
!!!!
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal, 114, 102, 174, 28.875).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoTrue
With ActiveWindow.Selection.TextRange.ParagraphFormat
.LineRuleWithin = msoTrue
.SpaceWithin = 1
.LineRuleBefore = msoTrue
.SpaceBefore = 0.5
.LineRuleAfter = msoTrue
.SpaceAfter = 0
End With
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,
Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "Red Hat"
With .Font
.Name = "Arial"
.Size = 18
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
End With
the addtextbox method I get this error. Other postings on this subject do not
solve my problem. I am using a licensed version Office 2003. I even
reinstalled it to repair files. This error usually happens if a dll is not
registered. However, since I've installed it twice...
Here's simple code. Note: error is on line with !!!! to the left.
Set AppPPT = CreateObject("PowerPoint.Application")
AppPPT.Visible = True
' If you want to hide the PowerPoint Window, set the visible property
' to FALSE and WithWindow argument of Open method to FALSE too.
AppPPT.Presentations.Open ("D:\Data\VBcode\VBPPT\sample.ppt")
With AppPPT.Presentations
' .Add WithWindow:=msoTrue
!!!!
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal, 114, 102, 174, 28.875).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoTrue
With ActiveWindow.Selection.TextRange.ParagraphFormat
.LineRuleWithin = msoTrue
.SpaceWithin = 1
.LineRuleBefore = msoTrue
.SpaceBefore = 0.5
.LineRuleAfter = msoTrue
.SpaceAfter = 0
End With
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,
Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "Red Hat"
With .Font
.Name = "Arial"
.Size = 18
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
End With