Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spces are not italics)
I'm just curious here, and thought I'd ask.
I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic = True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spcesare not italics)
On Dec 17, 7:27 pm, "CompleteNewb" wrote:
I'm just curious here, and thought I'd ask. I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic = True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time I'm no professional, just stopped in to see if my question has been addressed yet, so maybe I'm missing something -- but this sounds like a simple Find - Replace operation. If for some reason you don't want to simply Select All and click Italic, you can open the Replace panel (Ctrl-H, though it's not impossible that they've changed it in 2007), type a space in the upper box; place the cursor in the lower box, type a space, click More, click Format, choose Font, select Italic, then either go ahead and click Replace All, or test it on one example with Find Next and Replace. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spces are not italics)
Thanks for your response, but the entire document is not in italics, just
some phrases and sentences, as in a typical publication (italicized book titles, quotes, etc.), with the rest normal non-italicized. I don't want to turn the whole document into italics, I just want to get the italicized phrases and sentences to be italicized in their entirety, instead of italicized words broken up with NONitalicized spaces. Example: The favorite book among young readers is italics startJackitalics stop italics startanditalics stop italics starttheitalics stop itsalics startBeanstalkitalics stop I'm using the italics start and italics stop becuase I'm posting in plain text. But you can see that the problem, as specified in my first post, is that within the italicized phrase, which looks fine when printed, there are nonitalicized spaces (I don't know how that happened, but it did). "grammatim" wrote in message ... On Dec 17, 7:27 pm, "CompleteNewb" wrote: I'm just curious here, and thought I'd ask. I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic = True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time I'm no professional, just stopped in to see if my question has been addressed yet, so maybe I'm missing something -- but this sounds like a simple Find - Replace operation. If for some reason you don't want to simply Select All and click Italic, you can open the Replace panel (Ctrl-H, though it's not impossible that they've changed it in 2007), type a space in the upper box; place the cursor in the lower box, type a space, click More, click Format, choose Font, select Italic, then either go ahead and click Replace All, or test it on one example with Find Next and Replace. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spcesare not italics)
You appear to be at home in VBA, which I know nothing about, but I can
offer a way to do it fairly quickly by hand. Do a Find where the search item is nothing but Format Font Italic; after you Find the first occurrence, close the Find window (you'll use the Find Down arrow at the bottom of the vertical scroll bar from now on). It Finded the first italicized word. If this is the beginning of one of the phrases you need to fix, Shift-click at the end of the last word you want included in the phrase, to select the whole phrase, and click Italic twice (or press Ctrl-I twice). The first click will de- italicize the word that you Finded, the second one will italicize the phrase you selected. Click the Find Down arrow, and repeat. On Dec 18, 10:03 am, "CompleteNewb" wrote: Thanks for your response, but the entire document is not in italics, just some phrases and sentences, as in a typical publication (italicized book titles, quotes, etc.), with the rest normal non-italicized. I don't want to turn the whole document into italics, I just want to get the italicized phrases and sentences to be italicized in their entirety, instead of italicized words broken up with NONitalicized spaces. Example: The favorite book among young readers is italics startJackitalics stop italics startanditalics stop italics starttheitalics stop itsalics startBeanstalkitalics stop I'm using the italics start and italics stop becuase I'm posting in plain text. But you can see that the problem, as specified in my first post, is that within the italicized phrase, which looks fine when printed, there are nonitalicized spaces (I don't know how that happened, but it did). "grammatim" wrote in message ... On Dec 17, 7:27 pm, "CompleteNewb" wrote: I'm just curious here, and thought I'd ask. I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic= True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time I'm no professional, just stopped in to see if my question has been addressed yet, so maybe I'm missing something -- but this sounds like a simple Find - Replace operation. If for some reason you don't want to simply Select All and clickItalic, you can open the Replace panel (Ctrl-H, though it's not impossible that they've changed it in 2007), type a space in the upper box; place the cursor in the lower box, type a space, click More, click Format, choose Font, selectItalic, then either go ahead and click Replace All, or test it on one example with Find Next and Replace.- |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spces are not italics)
Thanks again for your attempts to helpl, they are much appreciated, but this
document is hundreds of pages long, with very many italicized items. What I'm trying to do is automate this in some way, since doing it manually would take many hours. Thanks again "grammatim" wrote in message ... You appear to be at home in VBA, which I know nothing about, but I can offer a way to do it fairly quickly by hand. Do a Find where the search item is nothing but Format Font Italic; after you Find the first occurrence, close the Find window (you'll use the Find Down arrow at the bottom of the vertical scroll bar from now on). It Finded the first italicized word. If this is the beginning of one of the phrases you need to fix, Shift-click at the end of the last word you want included in the phrase, to select the whole phrase, and click Italic twice (or press Ctrl-I twice). The first click will de- italicize the word that you Finded, the second one will italicize the phrase you selected. Click the Find Down arrow, and repeat. On Dec 18, 10:03 am, "CompleteNewb" wrote: Thanks for your response, but the entire document is not in italics, just some phrases and sentences, as in a typical publication (italicized book titles, quotes, etc.), with the rest normal non-italicized. I don't want to turn the whole document into italics, I just want to get the italicized phrases and sentences to be italicized in their entirety, instead of italicized words broken up with NONitalicized spaces. Example: The favorite book among young readers is italics startJackitalics stop italics startanditalics stop italics starttheitalics stop itsalics startBeanstalkitalics stop I'm using the italics start and italics stop becuase I'm posting in plain text. But you can see that the problem, as specified in my first post, is that within the italicized phrase, which looks fine when printed, there are nonitalicized spaces (I don't know how that happened, but it did). "grammatim" wrote in message ... On Dec 17, 7:27 pm, "CompleteNewb" wrote: I'm just curious here, and thought I'd ask. I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic= True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time I'm no professional, just stopped in to see if my question has been addressed yet, so maybe I'm missing something -- but this sounds like a simple Find - Replace operation. If for some reason you don't want to simply Select All and clickItalic, you can open the Replace panel (Ctrl-H, though it's not impossible that they've changed it in 2007), type a space in the upper box; place the cursor in the lower box, type a space, click More, click Format, choose Font, selectItalic, then either go ahead and click Replace All, or test it on one example with Find Next and Replace.- |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Fixing breaks in formatting (ie. italicized sentence, but spcesare not italics)
Very, very limited testing, but this may do:
Sub ScratchMacro() Dim oWord As Range Dim oRng As Word.Range For Each oWord In ActiveDocument.Range.Words On Error GoTo Err_Handler If oWord.Font.Italic = True And oWord.Next.Font.Italic = True Then Set oRng = oWord oRng.Start = oWord.End - 1 oRng.End = oWord.Next.Start oRng.MoveStartWhile Cset:=Chr(32), Count:=-1 oRng.Font.Italic = True End If Next oWord Err_Handler: End Sub On Dec 18, 9:44 pm, "CompleteNewb" wrote: Thanks again for your attempts to helpl, they are much appreciated, but this document is hundreds of pages long, with very many italicized items. What I'm trying to do is automate this in some way, since doing it manually would take many hours. Thanks again "grammatim" wrote in message ... You appear to be at home in VBA, which I know nothing about, but I can offer a way to do it fairly quickly by hand. Do a Find where the search item is nothing but Format Font Italic; after you Find the first occurrence, close the Find window (you'll use the Find Down arrow at the bottom of the vertical scroll bar from now on). It Finded the first italicized word. If this is the beginning of one of the phrases you need to fix, Shift-click at the end of the last word you want included in the phrase, to select the whole phrase, and click Italic twice (or press Ctrl-I twice). The first click will de- italicize the word that you Finded, the second one will italicize the phrase you selected. Click the Find Down arrow, and repeat. On Dec 18, 10:03 am, "CompleteNewb" wrote: Thanks for your response, but the entire document is not in italics, just some phrases and sentences, as in a typical publication (italicized book titles, quotes, etc.), with the rest normal non-italicized. I don't want to turn the whole document into italics, I just want to get the italicized phrases and sentences to be italicized in their entirety, instead of italicized words broken up with NONitalicized spaces. Example: The favorite book among young readers is italics startJackitalics stop italics startanditalics stop italics starttheitalics stop itsalics startBeanstalkitalics stop I'm using the italics start and italics stop becuase I'm posting in plain text. But you can see that the problem, as specified in my first post, is that within the italicized phrase, which looks fine when printed, there are nonitalicized spaces (I don't know how that happened, but it did). "grammatim" wrote in message ... On Dec 17, 7:27 pm, "CompleteNewb" wrote: I'm just curious here, and thought I'd ask. I've discovered that a lot of the italicized phrases in my VERY long Word document have the WORDS in italics, but for some reason the spaces between the words are NOT. So, when I run my macro to place all italicized phrases inside html tags, I get every word enclosed in the tags instead of the entire sentence/phrase. Is there any way to: 1) Fix the non-formatted SPACES between words that are italicized in Word before running the macro OR 2) Fixing it within the code of the macro. Here's what I have for the bracket thing: Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Font.Italic= True .Replacement.ClearFormatting .Text = "" .Replacement.Text = "em^&/em]" .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .ClearFormatting End With Thanks for any ideas or comments on this, and for taking the time I'm no professional, just stopped in to see if my question has been addressed yet, so maybe I'm missing something -- but this sounds like a simple Find - Replace operation. If for some reason you don't want to simply Select All and clickItalic, you can open the Replace panel (Ctrl-H, though it's not impossible that they've changed it in 2007), type a space in the upper box; place the cursor in the lower box, type a space, click More, click Format, choose Font, selectItalic, then either go ahead and click Replace All, or test it on one example with Find Next and Replace.-- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
italicized word in dictionary | Microsoft Word Help | |||
Lost formatting (italics) in footnotes -why | Microsoft Word Help | |||
I have no italics in my word document but random italics appear w. | Microsoft Word Help | |||
Table of Contents and Headings Italicized for Certain Style | Microsoft Word Help | |||
why is italicized text not showing on screen? | Microsoft Word Help |