Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
CompleteNewb CompleteNewb is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
grammatim[_2_] grammatim[_2_] is offline
external usenet poster
 
Posts: 2,751
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
CompleteNewb CompleteNewb is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
grammatim[_2_] grammatim[_2_] is offline
external usenet poster
 
Posts: 2,751
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
CompleteNewb CompleteNewb is offline
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
italicized word in dictionary the poet Microsoft Word Help 3 August 28th 06 01:35 PM
Lost formatting (italics) in footnotes -why caroleanne Microsoft Word Help 0 June 1st 06 07:00 PM
I have no italics in my word document but random italics appear w. San Microsoft Word Help 8 August 23rd 05 12:38 AM
Table of Contents and Headings Italicized for Certain Style LBinDC Microsoft Word Help 2 March 4th 05 06:21 PM
why is italicized text not showing on screen? littleholzer Microsoft Word Help 1 January 25th 05 03:48 PM


All times are GMT +1. The time now is 11:29 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"