How can i get the text of powerpoint embeded excel text ? | Newbie | | Join Date: Jul 2009
Posts: 9
| | |
Powerpoint ver = 2003
Visual basic = 2008
This time i want to try to do, extract the text from powerpoint embeded excel data and show into my treeview?
|  | Expert | | Join Date: Jul 2008 Location: Utrecht, The Netherlands
Posts: 287
| | | re: How can i get the text of powerpoint embeded excel text ?
Can you try to give us some more details? What do you want? What did you do already?
Steven
| | Newbie | | Join Date: Jul 2009
Posts: 9
| | | re: How can i get the text of powerpoint embeded excel text ?
Hi
I am doing this -
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim pptExtractTextList As New List(Of String)
-
g_PPTApp = New PowerPoint.Application
-
g_PPTApp.Visible = MsoTriState.msoTrue
-
-
Dim powerP As PowerPoint.Presentation = g_PPTApp.Presentations.Open(Me.txtOpenPath.Text, , , MsoTriState.msoCTrue)
-
-
For Each slide As PowerPoint.Slide In powerP.Application.ActivePresentation.Slides
-
For Each shape As PowerPoint.Shape In slide.Shapes
-
''I trying to get excel embeded text
-
If shape.Type = MsoShapeType.msoEmbeddedOLEObject Then
-
-
End If
-
Next
-
Next slide
-
-
powerP.Close()
-
powerP = Nothing
-
-
For Each FrameText As String In pptExtractTextList
-
Me.TreeView1.Nodes.Add(FrameText)
-
Next
-
-
End Sub
Thanks for any help
|  | Expert | | Join Date: Jul 2008 Location: Utrecht, The Netherlands
Posts: 287
| | | re: How can i get the text of powerpoint embeded excel text ?
Ok, but can you elaborate on what you're exactly trying to accomplish?
Steven
| | Newbie | | Join Date: Jul 2009
Posts: 9
| | | re: How can i get the text of powerpoint embeded excel text ?
Hi steven
I am trying to do the following.......
I open the ppt file where have a embeded excel data. But i can not know that how can get the followings...............
1. How can i get value of embeded excel sheet count
2. How can i get excel total rows
3. How can i get excel total columns
4. How can i get excel cells value
Thanks for again
| | Newbie | | Join Date: Jul 2009
Posts: 9
| | | re: How can i get the text of powerpoint embeded excel text ?
Hi
I am able to do this code.............. - Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim pptApp As PowerPoint.Application
-
pptApp = New PowerPoint.Application
-
pptApp.Visible = MsoTriState.msoTrue
-
Dim oFile As String = "C:\Documents and Settings\sarkar\デスクトップ\test.ppt"
-
Dim powerP As PowerPoint.Presentation = pptApp.Presentations.Open(oFile, MsoTriState.msoTrue)
-
-
With powerP
-
For Each slide As PowerPoint.Slide In powerP.Slides
-
For Each shape As PowerPoint.Shape In slide.Shapes
-
-
Dim workbook As Object = shape.OLEFormat.Object
-
Dim worksheet As Object = workbook.worksheets(1)
-
-
With worksheet
-
.cells(1, 1).value = "dsadsa"
-
End With
-
Next
-
Next
-
End With
-
End Sub
Sarkar
| | Newbie | | Join Date: Jul 2009
Posts: 9
| | | re: How can i get the text of powerpoint embeded excel text ?
Hi
I am able to Extract the powerpoint embed excel sheet data by vb.net
This is my code................. -
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim pptApp As PowerPoint.Application
-
pptApp = New PowerPoint.Application
-
pptApp.Visible = MsoTriState.msoTrue
-
Dim oFile As String = "C:\Documents and Settings\sarkar\デスクトップ\test.ppt"
-
Dim powerP As PowerPoint.Presentation = pptApp.Presentations.Open(oFile, MsoTriState.msoTrue)
-
-
With powerP
-
For Each slide As PowerPoint.Slide In powerP.Slides
-
For Each shape As PowerPoint.Shape In slide.Shapes
-
-
Dim workbook As Object = shape.OLEFormat.Object
-
For Each sheet As Object In workbook.worksheets
-
With sheet
-
For clm As Integer = 1 To GetTotalColumn(sheet)
-
For row As Integer = 1 To GetTotalRow(sheet)
-
pptExtractTextList.Add(.cells(1, 1).value.ToString)
-
Next row
-
Next clm
-
End With
-
Next sheet
-
Next shap
-
Next slide
-
End With
-
End Sub
-
-
-
'' Create get total Column count function
-
-
Private Function GetTotalColumn(ByVal [DataSheet] As Object) As Integer
-
Dim colNum As Integer = 0
-
-
For Each col As Object In [DataSheet].Columns
-
Dim cells As Object = TryCast([DataSheet].Cells(1, colNum + 1), Object)
-
-
If cells IsNot Nothing Then
-
If cells.Value IsNot Nothing Then
-
colNum += 1
-
Else
-
Exit For
-
End If
-
End If
-
Next
-
-
Return colNum
-
End Function
-
-
" Create a get totolrowcount function
-
-
Private Function GetTotalRow(ByVal [DataSheet] As Object) As Integer
-
Dim rowNum As Integer = 0
-
-
For Each row As Object In [DataSheet].Rows
-
Dim cells As Object = TryCast([DataSheet].Cells(rowNum + 1, 1), Object)
-
If cells IsNot Nothing Then
-
If cells.Value IsNot Nothing Then
-
rowNum += 1
-
Else
-
Exit For
-
End If
-
End If
-
Next
-
Return rowNum
-
End Function
By sarkar(India)
|  | Similar Visual Basic .NET bytes | | | Forums
Visit our community forums for general discussions and latest on Bytes
/bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,590 network members.
|