Viewbasic
11-08-2008, 01:23 AM
Hello, could some one proof this code, I have tried numerous times to remedy the present error, however I have been Unsucessful.
:banghead: Please Help
Much Appreciated
I'm sorry I'm having problems uploading the code so here it is below:
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim intCountSldes As Integer
Dim intSldNum As Integer
Dim sldComp As Slide
Dim strCompany As String
strCompany = txtCompany
'Remove existing slides
With ActivePresentation
For intCountSldes = 1 To .Slides.Count
.Slides(1).Delete
Next
End With
'Adds Title page to presentation
Set sldComp = ActivePresentation.Slides(intCountSldes)
sldComp.Layout = ppLayoutTitle
'Inserts Text into Title Shape
With sldComp.Shapes(1).TextFrame.TextRange
.Lines(1) = strCompany
End With
'Inserts Time and Date
With sldComp.Shapes(2).TextFrame.TextRange
.Lines(3).InsertDateTime ppDateTimeMMMMdyyyy
End With
'Inserts code which formats and adds new slides
With ActivePresentation.Slides
.Add .ppLayoutTitle
End With
'Trouble area: I'm having trouble creating a code which adds new slides and formats the new slides to text
'
Any suggestions?
With ActivePresentation.Slides
.Add .Count + 1, ppLayoutText
End With
'Deletes textbox sets focus
txtCompany = ""
txtCompany.SetFocus
'end code
End Sub
:banghead: Please Help
Much Appreciated
I'm sorry I'm having problems uploading the code so here it is below:
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim intCountSldes As Integer
Dim intSldNum As Integer
Dim sldComp As Slide
Dim strCompany As String
strCompany = txtCompany
'Remove existing slides
With ActivePresentation
For intCountSldes = 1 To .Slides.Count
.Slides(1).Delete
Next
End With
'Adds Title page to presentation
Set sldComp = ActivePresentation.Slides(intCountSldes)
sldComp.Layout = ppLayoutTitle
'Inserts Text into Title Shape
With sldComp.Shapes(1).TextFrame.TextRange
.Lines(1) = strCompany
End With
'Inserts Time and Date
With sldComp.Shapes(2).TextFrame.TextRange
.Lines(3).InsertDateTime ppDateTimeMMMMdyyyy
End With
'Inserts code which formats and adds new slides
With ActivePresentation.Slides
.Add .ppLayoutTitle
End With
'Trouble area: I'm having trouble creating a code which adds new slides and formats the new slides to text
'
Any suggestions?
With ActivePresentation.Slides
.Add .Count + 1, ppLayoutText
End With
'Deletes textbox sets focus
txtCompany = ""
txtCompany.SetFocus
'end code
End Sub