Go Back    Forum > Digital Life > Computers

Reply
 
LinkBack Thread Tools
  #1  
06-13-2017, 02:25 AM
datanumen datanumen is offline
Invalid Email / Banned / Spammer
 
Join Date: Jun 2017
Posts: 1
Thanked 0 Times in 0 Posts
Hello

When I type two words in the end of a line, then the two words may be apart to different lines in Word document as there is no enough space. One locates in the end of a line, another locates in the start of next line.

But for some special words, I don't want to break them into two lines. I hope they can always stay in the same line. How can I do this in Word 2010?

-- merged --

For that, there many ways to do that.

Method 1: Use Non-breaking Space
Just select the space between the two words which you want to stick them together, press “Ctrl+ Shift+ Space bar”.


Method 2: Use “Replace” Feature
1. To start with, select all target words.
2. Then click “Replace” in “Editing” group under “Home” tab. Or press “Ctrl+ H” instead.
3. Ensure the “Replace” tab is on. Enter one space in “Find what” text box.
4. And input “^s” in “Replace with” text box.
5. Lastly, click “Replace All”.
6. Click “No” to stop performing replacement on the whole document.

Method 3: Run Macro
Sub ReplaceSpaceWithNonBreakingSpace()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting

With Selection.Find
.text = " "
.Replacement.text = "^s"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

More details see at
Code:
https://www.datanumen.com/blogs/3-ways-prevent-closely-related-words-breaking-across-two-lines-word-document
Hope it will help.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
06-17-2017, 01:34 AM
admin's Avatar
admin admin is offline
Site Staff | Web Development
 
Join Date: Jul 2003
Posts: 4,310
Thanked 654 Times in 457 Posts
This was a novel attempt at spam, but quite obvious to Site Staff.

It's being left simply due to the fact that it's an unusual question: How to keep text on a single line, and disallow with-space terms from wrapping to a new line. I cannot imagine when such a need would arise, but I'll keep it handy just in case things change.

Hyphenated terms also wrap automatically, but there may be a disable that. If not, then I can for sure see the needs (mostly for OCD reasons) to non-wrap hyphenated.

The non-link (ie, no SEO for you!) was left, but method #1 (reason it's bolded) is want I'd do: the NBSP. Anybody familiar with HTML coding will know what that is. Usually, you just hit SHIFT+SPACE. Word seems to requires CTRL+SHFT+SPACE.

- Did this site help you? Then upgrade to Premium Member and show your support!
- Also: Like Us on Facebook for special DVD/Blu-ray news and deals!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Modern capture devices without breaking the bank? (Windows 10) holocron Capture, Record, Transfer 3 11-05-2016 04:37 AM
Remove extra lines (empty lines) from copied/pasted text with Notepad++ kpmedia Computers 1 10-07-2011 05:32 PM
How to convert Word HTML tables to Dreamweaver code naimeiiz Website and Server Troubleshooting 1 10-02-2011 04:41 PM
Getting text messages off phones ? Sossity Digital Devices 1 09-20-2011 06:05 AM
How to create PDFs from Word documents for free? kpmedia Computers 2 08-27-2010 12:20 PM

Thread Tools



 
All times are GMT -5. The time now is 04:03 PM