B
Boots
Hi,
I'm creating a power point on the fly using VB.NET. The power point has
10 sheets with approx 500 text boxs in total. The problem I'm having is
performance. On one sheet I'm creating 130 boxs its taking approx 40
seconds to draw. Unfortunatly this is unacceptabe to the end user.
The code I'm using to add and format a text box is as follows:
Can anyone please help ? how can I increase performance ? what options
are open to me using VB.NET to create a powerpoint ?
Thanks,
Sub DrawPPTTextBoxFromControl(ByVal objSlide As PowerPoint.Slide, ByRef
objControl As Control)
Dim objNewObject
objNewObject =
objSlide.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal,
objControl.Left, objControl.Top, objControl.Width, objControl.Height)
With objNewObject.TextFrame
' If blnWordwrap Then
.WordWrap = Office.MsoTriState.msoTrue
' Else
' .WordWrap = Office.MsoTriState.msoFalse
' End If
With .TextRange
If objControl.Text = "" Then
.Text = " "
Else
.Text = objControl.Text
End If
With .ParagraphFormat
' .Alignment
'.SpaceWithin = intParagraphSpacing
' .WordWrap = Office.MsoTriState.msoTrue
' .Bullet = blnBullet
End With
With .Font
.Name = objControl.Font.Name
.Size = objControl.Font.Size
.Bold = objControl.Font.Bold
.Italic = objControl.Font.Italic
.Underline = objControl.Font.Underline
End With
End With
End With
objNewObject.Visible = Office.MsoTriState.msoTrue
objNewObject = Nothing
End Sub
I'm creating a power point on the fly using VB.NET. The power point has
10 sheets with approx 500 text boxs in total. The problem I'm having is
performance. On one sheet I'm creating 130 boxs its taking approx 40
seconds to draw. Unfortunatly this is unacceptabe to the end user.
The code I'm using to add and format a text box is as follows:
Can anyone please help ? how can I increase performance ? what options
are open to me using VB.NET to create a powerpoint ?
Thanks,
Sub DrawPPTTextBoxFromControl(ByVal objSlide As PowerPoint.Slide, ByRef
objControl As Control)
Dim objNewObject
objNewObject =
objSlide.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal,
objControl.Left, objControl.Top, objControl.Width, objControl.Height)
With objNewObject.TextFrame
' If blnWordwrap Then
.WordWrap = Office.MsoTriState.msoTrue
' Else
' .WordWrap = Office.MsoTriState.msoFalse
' End If
With .TextRange
If objControl.Text = "" Then
.Text = " "
Else
.Text = objControl.Text
End If
With .ParagraphFormat
' .Alignment
'.SpaceWithin = intParagraphSpacing
' .WordWrap = Office.MsoTriState.msoTrue
' .Bullet = blnBullet
End With
With .Font
.Name = objControl.Font.Name
.Size = objControl.Font.Size
.Bold = objControl.Font.Bold
.Italic = objControl.Font.Italic
.Underline = objControl.Font.Underline
End With
End With
End With
objNewObject.Visible = Office.MsoTriState.msoTrue
objNewObject = Nothing
End Sub