PDA

View Full Version : Formatting sentences?



Dreamdweller
04-20-2012, 04:53 PM
I'm trying to get a code to format sentences after I have copied and pasted into a word document. For some reason the sentences are not compiled together. Inotherwords the sentences look like this:

Here is
an example of what I mean. The sentences for some reason are "broken" up and not put together.
It will, however, seem to work if I put a small enough
font into the file.
But I want it to work with any font I choose to use. I can only assume that I have to match the font that was
used when I copied and pasted it.

Now here is what it should look like:

Here is an example of what I mean. The sentences for some reason are "broken" up and not put together. It will, however, seem to work if I put a small enough font into the file. But I want it to work with any font I choose to use. I can only assume that I have to match the font that was used when I copied and pasted it.

If I use a different font and the sentences are broken I have to go through and put them "together". Is there a code that would do this? Or do I have to settle for using a specific font?

BoatwrenchV8
04-20-2012, 06:35 PM
Just a thought. Are you displaying all characters? You can set what hidden characters to display by going to File, Options, Display. The Ribbon button to toggle display all characters on and off is shown in the attached picture with the black arrow pointing to it. The mark looks like a paragraph mark. My suspicion is you have either manual line breaks, paragraph marks / carriage returns in the copied text but cannot see it. Have you tried to Paste, Keep Text Only? When you say Font, do you mean Font or do you mean Style?

Paul_Hossler
04-20-2012, 07:26 PM
after I have copied and pasted into a word document.


What are you pasting from? Another Word document, a plain text, or a web page?

Paul

fumei
04-20-2012, 09:51 PM
It sure looks like line breaks to me. I agree with boatwrench, show all characters. Please answer Paul's question about where the text is coming from. This will help.

macropod
04-21-2012, 02:31 AM
See: http://www.vbaexpress.com/forum/showthread.php?t=41787
Other than the 'Style' code there (which you may not need), the macro I posted probably has all you need.

Dreamdweller
04-21-2012, 03:21 PM
Just a thought. Are you displaying all characters? You can set what hidden characters to display by going to File, Options, Display. The Ribbon button to toggle display all characters on and off is shown in the attached picture with the black arrow pointing to it. The mark looks like a paragraph mark. My suspicion is you have either manual line breaks, paragraph marks / carriage returns in the copied text but cannot see it. Have you tried to Paste, Keep Text Only? When you say Font, do you mean Font or do you mean Style?
I am coping and pasting from another word document from an online source. There aren't any other characters that I am coping....just the words. I'm not doing anything to the style. I'm coping it as is and pasting it the same way (using Text only) as you had said. I'll trying changing the line breaks and carriage returns and see if that helps.

Dreamdweller
04-21-2012, 03:36 PM
Other than the 'Style' code there (which you may not need), the macro I posted probably has all you need.


Probably a dumb question but when you say on your macro posting to change "Somestyle" you are refering to anything like Aerial, comic sans and so on yes?

macropod
04-21-2012, 03:51 PM
Probably a dumb question but when you say on your macro posting to change "Somestyle" you are refering to anything like Aerial, comic sans and so on yes?
No. A paragraph Style is a set of parameters that determine everything about how a paragraph is formatted, from indents & alignment to font names, sizes, colors, etc. A character Style can be used to overlay text in a given a paragraph Style with additional attributes (eg bold type, a different colour). You really should learn about Styles and how to use them.