Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2014, 07:06 AM
bnyamin bnyamin is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 64bit
Advanced Beginner
Split a paragraph
 
Join Date: Oct 2014
Posts: 36
bnyamin is on a distinguished road
Question Split a paragraph

way Split a paragraph over 2000 word and create a


new paragraph
Reply With Quote
  #2  
Old 10-03-2014, 07:19 AM
gmayor's Avatar
gmayor gmayor is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Press the enter key?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-03-2014, 07:21 AM
gmaxey gmaxey is offline Split a paragraph Windows 7 32bit Split a paragraph Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Since this is a VBA forum, perhaps the OP needs a VBA solution:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
If Selection.Paragraphs(1).Range.Words.Count > 2000 Then
  Selection.InsertParagraph
End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 10-03-2014, 05:38 PM
fumei fumei is offline Split a paragraph Windows 7 64bit Split a paragraph Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

More to the point, "split" how, where?
Reply With Quote
  #5  
Old 10-03-2014, 09:46 PM
gmayor's Avatar
gmayor gmayor is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by gmaxey View Post
Since this is a VBA forum, perhaps the OP needs a VBA solution:
Undoubtedly, but it would need a lot more information in order to provide that. Is the paragraph 2000 words or does it need to be split at 2000 words?

What constitutes a 'word' and where in relation to that 2000th word should the text (I hesitate to call it a paragraph) be split? At the end of the 2000th word? At the end of the current sentence? At the beginning of the current sentence? Does the text even have sentences?

If the former, the task is impossible. You cannot produce a grammatically correct text by splitting a larger text using VBA. A paragraph is more than simply an arbitrarily broken piece of text. Hence my earlier reply.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #6  
Old 10-03-2014, 11:12 PM
fumei fumei is offline Split a paragraph Windows 7 64bit Split a paragraph Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Split at the 100th word? At the 1000th word?
Reply With Quote
  #7  
Old 10-04-2014, 04:53 AM
bnyamin bnyamin is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 64bit
Advanced Beginner
Split a paragraph
 
Join Date: Oct 2014
Posts: 36
bnyamin is on a distinguished road
Default

Thanks all friends' answers
That was not my intention by asking that question
To make myself clear I need a vba code to classify each paragraph not more than 2000 words, and the beginning of each paragraph starts with the word resume or continuance. Regardless of grammatically wrong sentences.
Again I thank you for your attention
Best regards
Reply With Quote
  #8  
Old 10-04-2014, 05:44 AM
gmaxey gmaxey is offline Split a paragraph Windows 7 32bit Split a paragraph Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Classify such paragraphs how\what? Paragraphs start with sentences. Sentences start, typically with a capitalized word "Resume", "Continuance."

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
  For Each oPar In ActiveDocument.Paragraphs
    If oPar.Range.Words.Count < 2000 Then
      Select Case Trim(oPar.Range.Words(1))
        Case "Resume", "Continuance"
          MsgBox "Classify me how\hat?"
      End Select
    End If
  Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #9  
Old 10-04-2014, 06:27 AM
fumei fumei is offline Split a paragraph Windows 7 64bit Split a paragraph Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Quote:
That was not my intention by asking that question
To make myself clear I need a vba code to classify each paragraph not more than 2000 words, and the beginning of each paragraph starts with the word resume or continuance. Regardless of grammatically wrong sentences.
When posting you MUST be precise and clear. This is what I think you mean...but I could be wrong, because you are NOT precise and clear.

IF a paragraph is < 2000 words;
AND ONLY if that paragraph starts with "resume" or "continuance"

go to the end of that paragraph and add a paragraph mark.


If the paragraph is <2000 words, and does NOT start with "resume" or "continuance", do nothing.
If the paragraph starts with "Resume" or "Continuance", do nothing.
If the paragraph is 2000 words, or greater, do nothing.


Remember THAT is precise what you said to do. Is this correct?
Reply With Quote
  #10  
Old 10-05-2014, 05:16 AM
bnyamin bnyamin is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 64bit
Advanced Beginner
Split a paragraph
 
Join Date: Oct 2014
Posts: 36
bnyamin is on a distinguished road
Smile description

for example i have ten paragraph with different words into
for example first paragraph for me formation feature or property enumerate 1500 words , this paragraph is correct for me.
but , for example second paragraph for me formation feature or property enumerate 3000 words , this paragraph is incorrect for me ...
and i need one paragraph with 2000 words and then create new paragraph with 1000 word .
for example Third paragraph for me formation feature or property enumerate 5000 words , this paragraph is incorrect for me ...
and i need two paragraph with 2000 words and then create new paragraph with 1000 word
i need only , into paragraph for me max 2000 words then create new paragraph in the new line
and...
when create new paragraph , insert for firsten word "Continuance" with vba code
i insert two files and describe with samples for you..
name for firsten file is "befor "
and name for second file is "after"
this file create 7252 words ...
Attached Files
File Type: doc befor.doc (81.0 KB, 15 views)
File Type: doc after.doc (80.5 KB, 16 views)
Reply With Quote
  #11  
Old 10-05-2014, 06:21 AM
fumei fumei is offline Split a paragraph Windows 7 64bit Split a paragraph Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

I am sorry, but those documents are so terrible, so bad, with such poor structure, I can not look at them. I hope someone else can help you.

I have no idea why you want such a "result". but the "after" document is so bad, I want nothing to do with it.
Reply With Quote
  #12  
Old 10-05-2014, 08:20 AM
bnyamin bnyamin is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 64bit
Advanced Beginner
Split a paragraph
 
Join Date: Oct 2014
Posts: 36
bnyamin is on a distinguished road
Default

Quote:
Originally Posted by fumei View Post
I am sorry, but those documents are so terrible, so bad, with such poor structure, I can not look at them. I hope someone else can help you.

I have no idea why you want such a "result". but the "after" document is so bad, I want nothing to do with it.
i need this code vba for separate text for CONTENT ANALYSIS in social science
Reply With Quote
  #13  
Old 10-05-2014, 09:54 AM
macropod's Avatar
macropod macropod is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, j As Long, RngPara As Range, RngTemp As Range
With ActiveDocument
  j = .Paragraphs.Count
  For i = 1 To j
    Set RngPara = .Paragraphs(i).Range
    Set RngTemp = .Paragraphs(i).Range
    With RngPara
      While .Paragraphs.Last.Range.ComputeStatistics(wdStatisticWords) > 2000
        Set RngTemp = .Paragraphs.Last.Range
        With RngTemp
          .End = .Start
          .MoveEnd wdWord, 2000
          While .ComputeStatistics(wdStatisticWords) <> 2000
            .MoveEnd wdWord, 2000 - .ComputeStatistics(wdStatisticWords)
          Wend
          .InsertAfter vbCr & "Continuance ... "
          j = j + 1
        End With
      Wend
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
PS: Please don't make duplicate posts.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #14  
Old 10-05-2014, 08:18 PM
bnyamin bnyamin is offline Split a paragraph Windows 7 64bit Split a paragraph Office 2010 64bit
Advanced Beginner
Split a paragraph
 
Join Date: Oct 2014
Posts: 36
bnyamin is on a distinguished road
Default

thanks thanks thanks , for answer
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Split Slide Akip Tsaqif PowerPoint 0 09-07-2014 10:50 PM
How to split .pst file annabrown8812 Outlook 1 10-03-2013 04:27 AM
Split a paragraph Narrow Paragraph to Wide Paragraph HELP icloudy Word 1 12-09-2012 03:49 PM
Split a task fridos Project 2 05-30-2011 11:19 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft