473,799 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get all word of slide through aspose.slide

Hi,

I have aspose slide component and i want to take all string in the
presentation's all slide but that component not give any method to get that
direct we have to take all shape's textframe and then take text i do that
things and then count words but i not get true word count can any one say me
the technique to get that or give me any code for that my code is following

Try
Dim lic As Aspose.Slides.L icense = New Aspose.Slides.
License
lic.SetLicense( HttpContext.Cur rent.Server.Map Path("bin").
ToString + "\\" + "Aspose.Custom. lic")
Dim srcPres As Presentation = New Presentation(ro ot)
Dim totalWords As Int64 = 0

For i As Integer = 1 To srcPres.Slides. LastSlidePositi on

Dim srcSld As Slide = srcPres.GetSlid eByPosition(i)

Dim thldText1 As String = srcSld.HeaderFo oter.
HeaderText.Repl ace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams1() As Char = {" "c}

Dim wordsInThisText Holder1 As Integer = thldText1.
Split(splitPara ms1, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Holder1
Dim thldText2 As String = srcSld.HeaderFo oter.
FooterText.Repl ace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams2() As Char = {" "c}

Dim wordsInThisText Holder2 As Integer = thldText2.
Split(splitPara ms2, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Holder2
If Not srcSld.Notes Is Nothing Then
Dim thldText3 As String = srcSld.Notes.Te xt.
Replace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams3() As Char = {" "c}

Dim wordsInThisText Holder3 As Integer = thldText2.
Split(splitPara ms3, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Holder3
End If

For Each shp As Shape In srcSld.Shapes

If Not shp.Placeholder Is Nothing Then

If TypeOf shp.Placeholder Is TextHolder Then

Dim thld As TextHolder = shp.Placeholder

Dim thldText As String = thld.Text.
Replace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")
Dim splitParams() As Char = {" "c}

Dim wordsInThisText Holder As Integer =
thldText.Split( splitParams, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Holder

Continue For

End If

End If

If TypeOf shp Is Aspose.Slides.T able Then
Dim dt As Aspose.Slides.T able = shp

For Each tShape As Aspose.Slides.S hape In dt.
Shapes
If tShape.TextFram e IsNot Nothing Then
Dim tfText As String = tShape.
TextFrame.Text. Replace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, "
")
Dim splitParams() As Char = {" "c}

Dim wordsInThisText Frame As Integer =
tfText.Split(sp litParams, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Frame
End If
Next
Continue For
End If

If TypeOf shp Is Aspose.Slides.R ectangle Then
Dim rect As Aspose.Slides.R ectangle = shp

If rect.TextFrame IsNot Nothing Then
Dim tfText As String = rect.TextFrame.
Text.Replace(vb Cr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")
Dim splitParams() As Char = {" "c}

Dim wordsInThisText Frame As Integer =
tfText.Split(sp litParams, StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords += wordsInThisText Frame
End If

Continue For
End If

If TypeOf shp Is Aspose.Slides.G roupShape Then
Try

Dim shp1 As Aspose.Slides.S hape = shp

'NextGr:

Dim dt As Aspose.Slides.G roupShape = shp1

For Each tShape As Aspose.Slides.S hape In
dt.Shapes

If TypeOf tShape Is Aspose.Slides.
Rectangle Then

Dim trect As Aspose.Slides.
Rectangle = tShape

If Not trect.TextFrame Is Nothing
Then

Dim tf As TextFrame = trect.
TextFrame

If Not tf.Text Is Nothing
Then

Dim tfText As String = ""

tfText = tf.Text.Replace
(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams() As Char
= {" "c}

Dim wordsInThisText Frame
As Integer = tfText.Split(sp litParams, StringSplitOpti ons.RemoveEmpty Entries).
Length

totalWords +=
wordsInThisText Frame
End If
End If
End If
If TypeOf tShape Is Aspose.Slides.
GroupShape Then

'totalWords += Group(tShape,
totalWords)
' shp1 = tShape

' GoTo NextGr

For Each tShape1 As Aspose.Slides.
Shape In dt.Shapes

If Not tShape1.TextFra me Is
Nothing Then
Dim tf As TextFrame =
tShape1.TextFra me

If Not tf.Text Is Nothing
Then

Dim tfText As String
= ""

tfText = tf.Text.
Replace(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams() As
Char = {" "c}

Dim
wordsInThisText Frame As Integer = tfText.Split(sp litParams,
StringSplitOpti ons.RemoveEmpty Entries).Length

totalWords +=
wordsInThisText Frame
End If
End If
Next
Else
If Not tShape.TextFram e Is
Nothing Then
Dim tf As TextFrame = tShape.
TextFrame

If Not tf.Text Is Nothing
Then

Dim tfText As String = ""

tfText = tf.Text.Replace
(vbCr, " ").Replace(vbLf , " ").Replace(vbVe rticalTab, " ")

Dim splitParams() As Char
= {" "c}

Dim wordsInThisText Frame
As Integer = tfText.Split(sp litParams, StringSplitOpti ons.RemoveEmpty Entries).
Length

totalWords +=
wordsInThisText Frame
End If
End If

End If

Next

Continue For

Catch ex As Exception

End Try

--
Ashish Langhnoja
..Net Developer (IntelSoft Soutions Pvt. Ltd.)
Gujarat(India)

Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...p-net/200710/1

Oct 30 '07 #1
0 2033

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1441
by: Sharon | last post by:
Following up, I've found success at last with Aspose, combining both Aspose.Word to create an xml file, and then and Aspose.Pdf to create the pdf file. This works out to be quite a considerable additional expense, though, with single-licence costs of AU$790 for Aspose.Word and AU$526 for Aspose.Pdf. I've tried to use the Word-generated xml document (thinking that I might be able to do something with microsoft.office.interop.word) as...
1
1097
by: Ryan Ternier | last post by:
We're looking for a 3rd party control that will take a Word (2000, xp, 2003) document / Excel document and convert it to HTML. Currently, we're opening up a copy of word on our servers, opening the document, and saving it as HTML for this. Microsoft doesn't reccomend this, and we're having issues now with our live servers running word XP and our devs running word 2003. If anyone knows any companies / products that can fit this need, it...
3
2174
by: kalamantina | last post by:
Hi everyone, I am trying to build a small library ( in C# and VS2003) that accepts a PDF file and converts it to a word document. During this process all alignments are to be kept. Is there a way to deo it through code, I am playing with the microsoft.office.interop.word dll but importing the PDf into a format
3
1756
by: Brian Cryer | last post by:
A project I'm about to start on has a requirement to create word documents on the fly for download from the website. To date all the code examples I've found on the net use automation (and by implication require office to be installed on the server). Am I right in assuming that using Automation to generate word documents is a bad idea for a webserver? I've always had the impression that with Excel the single threaded nature of it meant...
11
2614
by: sandeepkedlaya | last post by:
Hello, I need to copy images from a folder and copy to a word document. I have done as follows.. but It copies only last image. Can any one of you help me in this.. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Response.Buffer = True Dim DirPath As String DirPath = "D:\ASPDotNet\images\" Dim FileName As String
1
2683
by: =?Utf-8?B?QmFkaXM=?= | last post by:
I'm using automation for mail merging but the process hangs because at some stage some alerts may come around! I have tried: wrdApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; & wrdApp.DisplayAlerts =0; all I need is to produce a word document and save it in the back end. I don't need to see the word document while the process is done. so, is there a way to by pass there alerts?
11
1601
by: sajithkahawatta | last post by:
i wrote a code to read a doc and display that data on web page. in asp.net i woked properly in my iis ms word is installed in this pc. but when i published in another sever in which there is no ms word instslled it give error in it i used com reference. i want to know is there is a way to read a doc when ms word is not instslled on the server.
1
1284
by: guido | last post by:
I'm using aspose.words (www.aspose.com) to extract regular expression matches from multiple files within a folder. Unfortunately, aspose.words does not support pre-Word 97 documents. How can i retrieve the Word version of the .doc file, so i can avoid errors? Thanks.
2
1291
by: Ang | last post by:
hi all, First how can I make a word doc like this link? http://www.cityu.edu.hk/hro/job_v/appform/appform_adexe.doc And next how to collect the user inputed data in the word by c#? I searched many articles on Internet which all about collecting the whole content of word but no article about specific values from word,
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.