Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2015, 10:45 PM
PRA007's Avatar
PRA007 PRA007 is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 32bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Competent Performer
How to paste as a single para from clipboard having multiple paragraph
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default How to paste as a single para from clipboard having multiple paragraph

I have in clipboard text having page breaks

Quote:
The present invention provides a new synthetic process for the production of I -(2-((2,4-


dimethylphenyl)thio)phenyl)piperazine (vortioxetine), a drug for the treatment of depression and anxiety, which is conducted via
(2,4-dimethylphenyl)(2-iodophenyl)sulfane intermediate.
I want to paste it in this way
Quote:
The present invention provides a new synthetic process for the production of I -(2-((2,4- dimethylphenyl)thio)phenyl)piperazine (vortioxetine), a drug for the treatment of depression and anxiety, which is conducted via (2,4-dimethylphenyl)(2-iodophenyl)sulfane intermediate.
Means in place of paragraph(or say pagebreak) I want space.

Is there any inbuilt function for this?
Reply With Quote
  #2  
Old 11-03-2015, 11:44 PM
macropod's Avatar
macropod macropod is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

There is no paste function for what you want. There are macros for cleaning up text pasted from websites, emails & PDFs, but those are generally designed to work with large blocks of text. If you're interested in that kind of thing, see: https://www.msofficeforums.com/word/...html#post24698
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-04-2015, 03:06 AM
PRA007's Avatar
PRA007 PRA007 is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 32bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Competent Performer
How to paste as a single para from clipboard having multiple paragraph
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Thanks for answer.
Instead of clicking I copy pasted link in google and it lead me to.
http://www.vbaexpress.com/forum/show...raphs-from-PDF
Changed it the way you descrived. Solved my problem

Code:
Sub PasteCleanUpText() 
     
    Application.ScreenUpdating = False 
     
    Dim oRng As Range 
    Set oRng = Selection.Range 
    oRng.Paste 
     'oRng = Replace(oRng, Chr(13), " ")
     
    oRng.ParagraphFormat.Reset 
    oRng.Font.Reset 
     
    With oRng.Find 
        .ClearFormatting 
        .Replacement.ClearFormatting 
        .Forward = True 
        .Wrap = wdFindStop 
        .Format = False 
        .MatchAllWordForms = False 
        .MatchSoundsLike = False 
        .MatchWildcards = True 
         
         'Replace single paragraph breaks with a space
        .Text = "([!^13])([^13])([!^13])" 
        .Replacement.Text = "\1 \3" 
        .Execute Replace:=wdReplaceAll 
         
         'Replace all double spaces with single spaces
        .Text = "[ ]{2,}" 
        .Replacement.Text = " " 
        .Execute Replace:=wdReplaceAll 
         
         'Delete hypens in hyphenated text formerly split across lines
         '.Text = "([a-z])-[ ]{1,}([a-z])"
         '.Replacement.Text = "\1 \2" 'formerly \1\2
         '.Execute Replace:=wdReplaceAll
         
         'Limit paragraph breaks to one per 'real' paragraph.
        .Text = "[^13]{1,}" 
        .Replacement.Text = "^p" 
        .Execute Replace:=wdReplaceAll 
         
    End With 
     
    Application.ScreenUpdating = True 
     
End Sub
Reply With Quote
  #4  
Old 11-04-2015, 03:50 AM
macropod's Avatar
macropod macropod is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

As you will see from where you got that code, there were problems with it - and I provided advice about that. The code in the link in post #2 is superior.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-04-2015, 05:11 AM
PRA007's Avatar
PRA007 PRA007 is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 32bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Competent Performer
How to paste as a single para from clipboard having multiple paragraph
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

ohh. It took some time to realize way I always lost the formatting.
for me my original document contains subscript and superscript etc. but while using above code removes it. Thanks for suggestion.
Reply With Quote
  #6  
Old 11-04-2015, 05:27 AM
macropod's Avatar
macropod macropod is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

The code in the link I posted doesn't remove such formatting...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 12-04-2015, 04:29 AM
PRA007's Avatar
PRA007 PRA007 is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Competent Performer
How to paste as a single para from clipboard having multiple paragraph
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

As This has solved my problem, can be marked as solved.
Reply With Quote
  #8  
Old 12-04-2015, 04:40 AM
macropod's Avatar
macropod macropod is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

You can mark threads as solved yourself, via the 'Thread Tools' dropdown.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 12-04-2015, 04:48 AM
PRA007's Avatar
PRA007 PRA007 is offline How to paste as a single para from clipboard having multiple paragraph Windows 7 64bit How to paste as a single para from clipboard having multiple paragraph Office 2010 32bit
Competent Performer
How to paste as a single para from clipboard having multiple paragraph
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Oh!!!. I thought....
I will do that from now onward.
Reply With Quote
Reply

Tags
word 2010, word vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to paste as a single para from clipboard having multiple paragraph How to select and copy to clipboard an entire document except for a paragraph and keep formatting TD_123 Word VBA 7 06-16-2015 03:30 PM
How can I temporarily break a 3 column format in order to type a single column paragraph William P Word 1 01-04-2015 06:40 PM
Controlling Widows (single-word lines at the end of a paragraph) downtownbooks Word 2 12-09-2014 03:57 PM
How to paste as a single para from clipboard having multiple paragraph Get para no where txt is found, and move text to end of paragraph using Word 201 marceepoo Word VBA 2 12-20-2012 11:42 AM
How to paste as a single para from clipboard having multiple paragraph A macro that can insert FILENAME, sendkeys CTRL ALT T, paste clipboard, and nextline kyjac85 Word VBA 13 09-20-2012 05:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:43 AM.


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