Connecting Tech Pros Worldwide Forums | Help | Site Map

How can i get the text of powerpoint embeded excel text ?

Newbie
 
Join Date: Jul 2009
Posts: 9
#1: Aug 5 '09
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?

MrMancunian's Avatar
Expert
 
Join Date: Jul 2008
Location: Utrecht, The Netherlands
Posts: 287
#2: Aug 5 '09

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
#3: Aug 6 '09

re: How can i get the text of powerpoint embeded excel text ?


Hi

I am doing this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim pptExtractTextList As New List(Of String)
  3.         g_PPTApp = New PowerPoint.Application
  4.         g_PPTApp.Visible = MsoTriState.msoTrue
  5.  
  6.         Dim powerP As PowerPoint.Presentation = g_PPTApp.Presentations.Open(Me.txtOpenPath.Text, , , MsoTriState.msoCTrue)
  7.  
  8.         For Each slide As PowerPoint.Slide In powerP.Application.ActivePresentation.Slides
  9.             For Each shape As PowerPoint.Shape In slide.Shapes
  10.                 ''I trying to get excel embeded text
  11.                 If shape.Type = MsoShapeType.msoEmbeddedOLEObject Then
  12.  
  13.                 End If
  14.             Next
  15.         Next slide
  16.  
  17.         powerP.Close()
  18.         powerP = Nothing
  19.  
  20.         For Each FrameText As String In pptExtractTextList
  21.             Me.TreeView1.Nodes.Add(FrameText)
  22.         Next
  23.  
  24. End Sub
Thanks for any help
MrMancunian's Avatar
Expert
 
Join Date: Jul 2008
Location: Utrecht, The Netherlands
Posts: 287
#4: Aug 6 '09

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
#5: Aug 6 '09

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
#6: Aug 6 '09

re: How can i get the text of powerpoint embeded excel text ?


Hi

I am able to do this code..............
Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim pptApp As PowerPoint.Application
  3.         pptApp = New PowerPoint.Application
  4.         pptApp.Visible = MsoTriState.msoTrue
  5.         Dim oFile As String = "C:\Documents and Settings\sarkar\デスクトップ\test.ppt"
  6.         Dim powerP As PowerPoint.Presentation = pptApp.Presentations.Open(oFile, MsoTriState.msoTrue)
  7.  
  8.         With powerP
  9.             For Each slide As PowerPoint.Slide In powerP.Slides
  10.                 For Each shape As PowerPoint.Shape In slide.Shapes
  11.  
  12.                     Dim workbook As Object = shape.OLEFormat.Object
  13.                     Dim worksheet As Object = workbook.worksheets(1)
  14.  
  15.                     With worksheet
  16.                         .cells(1, 1).value = "dsadsa"
  17.                     End With
  18.                 Next
  19.             Next
  20.         End With
  21. End Sub

Sarkar
Newbie
 
Join Date: Jul 2009
Posts: 9
#7: Aug 7 '09

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.................
Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.   Dim pptApp As PowerPoint.Application
  3.   pptApp = New PowerPoint.Application
  4.   pptApp.Visible = MsoTriState.msoTrue
  5.   Dim oFile As String = "C:\Documents and Settings\sarkar\デスクトップ\test.ppt"
  6.   Dim powerP As PowerPoint.Presentation = pptApp.Presentations.Open(oFile, MsoTriState.msoTrue)
  7.  
  8.   With powerP
  9.     For Each slide As PowerPoint.Slide In powerP.Slides
  10.       For Each shape As PowerPoint.Shape In slide.Shapes
  11.  
  12.         Dim workbook As Object = shape.OLEFormat.Object
  13.         For Each sheet As Object In workbook.worksheets
  14.           With sheet
  15.             For clm As Integer = 1 To GetTotalColumn(sheet)
  16.               For row As Integer = 1 To GetTotalRow(sheet)
  17.                 pptExtractTextList.Add(.cells(1, 1).value.ToString)
  18.               Next row
  19.             Next clm
  20.           End With
  21.         Next sheet
  22.       Next shap
  23.     Next slide
  24.   End With
  25. End Sub
  26.  
  27.  
  28. '' Create get total Column count function
  29.  
  30. Private Function GetTotalColumn(ByVal [DataSheet] As Object) As Integer
  31.   Dim colNum As Integer = 0
  32.  
  33.   For Each col As Object In [DataSheet].Columns
  34.     Dim cells As Object = TryCast([DataSheet].Cells(1, colNum + 1), Object)
  35.  
  36.     If cells IsNot Nothing Then
  37.       If cells.Value IsNot Nothing Then
  38.         colNum += 1
  39.       Else
  40.         Exit For
  41.       End If
  42.     End If
  43.   Next
  44.  
  45.   Return colNum
  46. End Function
  47.  
  48. " Create a get totolrowcount function
  49.  
  50. Private Function GetTotalRow(ByVal [DataSheet] As Object) As Integer
  51.   Dim rowNum As Integer = 0
  52.  
  53.   For Each row As Object In [DataSheet].Rows
  54.     Dim cells As Object = TryCast([DataSheet].Cells(rowNum + 1, 1), Object)
  55.     If cells IsNot Nothing Then
  56.       If cells.Value IsNot Nothing Then
  57.         rowNum += 1
  58.       Else
  59.         Exit For
  60.       End If
  61.     End If
  62.   Next
  63.   Return rowNum
  64. End Function
By sarkar(India)
Reply


Similar Visual Basic .NET bytes