- #How to insert non breaking space in word for mac manual
- #How to insert non breaking space in word for mac code
Select the paragraph or section of text you want to keep together.Instead, try the following Word techniques to keep text automatically together: When you don’t want a paragraph or even several lines of text to break between two pages, don’t press multiple keys to move text to the next page. Word represents non-breaking space characters with a degree symbol (°) and non-breaking hyphen characters with a double‑length hyphen (these are a bit harder to distinguish from regular text). To view non-breaking space and hyphen characters in a document, click Show/Hide in the Paragraph group (Home tab). Non-breaking hyphen: + + Īs the name implies, non-breaking characters connect the text together and the entire phrase or group of characters will all automatically move to the next line together but only as needed.Specifically, delete the spaces or hyphens and replace normal spaces and hyphens with non-breaking spaces or non-breaking hyphens: The right solution: keep text together with special characters.
#How to insert non breaking space in word for mac manual
And, this manual approach doesn’t work well if you have paragraph formatting or styles that adds space between paragraphs. Now you’re wasting time going back to remove these extra lines when you no longer need the forced break to the text. This is fine until any of the text changes and causes breaks in the wrong place. The common solution: what most people do to keep text together is move to the beginning of the text and press to start a new line. Non-Breaking Spaces & Non-Breaking Hyphens Your options for keeping text together in Microsoft Word include: Some examples of text you might want to keep together and not break up on separate lines: To learn these tricks to keep text together in Microsoft Word, continue reading or watch my how-to video: Fortunately, Word has some easy ways to keep text together. Word wrap is great except when it breaks up text we want to stay together such as dates, names, phone numbers, phrases, formulas, titles or other text that should remain together on the same line. The one that gets the extra lines is the only one wrapped tight.Most of the time, we want text in a Microsoft Word document to automatically wrap, that is, to move to the next line when it is too long to fit on one line. Possible avenue the groups are wrapped in 3 ways Square, Tight and Top & Bottom, the captions are all beneath the images (and grouped to them). This doesn't work for me and I am not familiar enough with Word VBA to work out why in all but one of my captions it doesn't do anything, in one of them it seems to add 2 new lines. 'since you aren't SETting the str over and over 'but I find this clearer and I think it will be marginally quicker 'NB I appreciate I could have put all my conditions in one IF with AND, TxRng.Text = str '.and set it (could have done in 1 step) Str = str & ChrW(160) 'create new string.
If Right(str, 1) ChrW(160) Then 'check for a space already present If txRng.Italic And = wdAlignParagraphRight Then 'only act on this sort of text Set txRng = tb.TextFrame.TextRange 'Get text content If tb.Type = msoTextBox Then 'Single out text-boxes
#How to insert non breaking space in word for mac code
Here's the code I came up with: Sub captionSpaces() 'placed in normal.dot moduleįor Each grp In ActiveDocument.Shapes 'all my textboxes are in groups - I might add handling in case they aren'tįor Each tb In grp.GroupItems 'Loop through all shapes in all groups I tried to create a macro to add a non breaking space to each textbox in my document, if: This is a known bug, and the solution on that page was to add in a non-breaking whitespace ( ctrl+ shift+ space or chrW(160) in VBA) Problem Or to accentuate with a more flourishy script:į is a good letter to recreate this problem with. Here's the situation where I noticed it first (zoomed in alot) When you create text boxes in word (I was using the auto caption on figures), use italicised text and align right, you often find a bit of the last letter can be cut off. Background (skip if needed, there to help people Googling the same problem)