Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Janet A. Thompson Janet A. Thompson is offline
external usenet poster
 
Posts: 57
Default Find Replace references from whatever they were to italics

I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have several
chapters to do this in. How to do? I do NOT want the actual caption on the
figure or table to pick up the italization but I want thses to retain their
figure or table title syles. Thanks
--
Janet A.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Find Replace references from whatever they were to italics

Use a macro containing the following code to add the \* charformat switch to
each of the cross reference fields and apply the Italic formatting to the
first letter of the field code which will cause the cross reference to be
displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have several
chapters to do this in. How to do? I do NOT want the actual caption on
the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Janet A. Thompson Janet A. Thompson is offline
external usenet poster
 
Posts: 57
Default Find Replace references from whatever they were to italics

I think this will work for the tables and figures, but the exhibits and
appendices are not put in with captioning and are not fields. I think I need
a simple Find and Replace for these but I don't know what it is? Does anyone
know?
--
Janet A.


"Doug Robbins - Word MVP" wrote:

Use a macro containing the following code to add the \* charformat switch to
each of the cross reference fields and apply the Italic formatting to the
first letter of the field code which will cause the cross reference to be
displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have several
chapters to do this in. How to do? I do NOT want the actual caption on
the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Find Replace references from whatever they were to italics

Hi Doug,

I think the macro should check for any \h switches in the fields concerned, as they'll throw a wobbly unless the \h switch comes
after the Charformat switch.

It's probably a good idea to delete any Mergeformat switches too, as they tell Word to format the field differently than the
Charformat switch and having both might lead to conflicts.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message ...
Use a macro containing the following code to add the \* charformat switch to each of the cross reference fields and apply the
Italic formatting to the first letter of the field code which will cause the cross reference to be displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message ...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have several
chapters to do this in. How to do? I do NOT want the actual caption on the
figure or table to pick up the italization but I want thses to retain their
figure or table title syles. Thanks
--
Janet A.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Find Replace references from whatever they were to italics

The following code should take care of that.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I think this will work for the tables and figures, but the exhibits and
appendices are not put in with captioning and are not fields. I think I
need
a simple Find and Replace for these but I don't know what it is? Does
anyone
know?
--
Janet A.


"Doug Robbins - Word MVP" wrote:

Use a macro containing the following code to add the \* charformat switch
to
each of the cross reference fields and apply the Italic formatting to the
first letter of the field code which will cause the cross reference to be
displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have
several
chapters to do this in. How to do? I do NOT want the actual caption
on
the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Find Replace references from whatever they were to italics

Hi Paul,

Just checked that and having the \* charformat at the end of the field
construction did not cause any problem with the functionality provided by
the \h switch.

By default, the REF _Ref fields do not have a \* mergeformat switch.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"macropod" wrote in message
...
Hi Doug,

I think the macro should check for any \h switches in the fields
concerned, as they'll throw a wobbly unless the \h switch comes after the
Charformat switch.

It's probably a good idea to delete any Mergeformat switches too, as they
tell Word to format the field differently than the Charformat switch and
having both might lead to conflicts.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message
...
Use a macro containing the following code to add the \* charformat switch
to each of the cross reference fields and apply the Italic formatting to
the first letter of the field code which will cause the cross reference
to be displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have
several
chapters to do this in. How to do? I do NOT want the actual caption on
the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.




  #7   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Find Replace references from whatever they were to italics

Hi Doug,

I was testing this earlier with Word 2000, and found having the CHARFORMATswitch after the \h switch resulted in and error message.
Can't reproduce it right now, though.

Also, if you try changing the format of a REF field from the keyboard, Word (2000) automatically adds \* MERGEFORMAT to the field.
It seems this is just as likely to be an issue if one applies a different format to the field after the CHARFORMAT switch has been
added.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message ...
Hi Paul,

Just checked that and having the \* charformat at the end of the field construction did not cause any problem with the
functionality provided by the \h switch.

By default, the REF _Ref fields do not have a \* mergeformat switch.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"macropod" wrote in message ...
Hi Doug,

I think the macro should check for any \h switches in the fields concerned, as they'll throw a wobbly unless the \h switch comes
after the Charformat switch.

It's probably a good idea to delete any Mergeformat switches too, as they tell Word to format the field differently than the
Charformat switch and having both might lead to conflicts.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message ...
Use a macro containing the following code to add the \* charformat switch to each of the cross reference fields and apply the
Italic formatting to the first letter of the field code which will cause the cross reference to be displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have several
chapters to do this in. How to do? I do NOT want the actual caption on the
figure or table to pick up the italization but I want thses to retain their
figure or table title syles. Thanks
--
Janet A.




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Find Replace references from whatever they were to italics

Although Word does add the \* MERGEFORMAT switch if you apply the formatting
manually, it does not do so when you use F&R; see
http://sbarnhill.mvps.org/WordFAQs/F...References.htm.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"macropod" wrote in message
...
Hi Doug,

I was testing this earlier with Word 2000, and found having the
CHARFORMATswitch after the \h switch resulted in and error message. Can't
reproduce it right now, though.

Also, if you try changing the format of a REF field from the keyboard,
Word (2000) automatically adds \* MERGEFORMAT to the field. It seems this
is just as likely to be an issue if one applies a different format to the
field after the CHARFORMAT switch has been added.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message
...
Hi Paul,

Just checked that and having the \* charformat at the end of the field
construction did not cause any problem with the functionality provided by
the \h switch.

By default, the REF _Ref fields do not have a \* mergeformat switch.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"macropod" wrote in message
...
Hi Doug,

I think the macro should check for any \h switches in the fields
concerned, as they'll throw a wobbly unless the \h switch comes after
the Charformat switch.

It's probably a good idea to delete any Mergeformat switches too, as
they tell Word to format the field differently than the Charformat
switch and having both might lead to conflicts.

--
Cheers
macropod
[Microsoft MVP - Word]


"Doug Robbins - Word MVP" wrote in message
...
Use a macro containing the following code to add the \* charformat
switch to each of the cross reference fields and apply the Italic
formatting to the first letter of the field code which will cause the
cross reference to be displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#,
or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have
several
chapters to do this in. How to do? I do NOT want the actual caption
on the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.





  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Janet A. Thompson Janet A. Thompson is offline
external usenet poster
 
Posts: 57
Default Find Replace references from whatever they were to italics

Doug,

I put this in my normal.dotx in 2007 but it shows 2 read lines in the
center"V" where I've put xxx's. How to fix? THANK YOU ALL.

' ChangetoItalic Macro
'
Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
xxx If UCase(.Characters(i)) = "R"
xxx .Characters(i).Font.Italic =
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With V"
--
Janet A.


"Doug Robbins - Word MVP" wrote:

The following code should take care of that.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I think this will work for the tables and figures, but the exhibits and
appendices are not put in with captioning and are not fields. I think I
need
a simple Find and Replace for these but I don't know what it is? Does
anyone
know?
--
Janet A.


"Doug Robbins - Word MVP" wrote:

Use a macro containing the following code to add the \* charformat switch
to
each of the cross reference fields and apply the Italic formatting to the
first letter of the field code which will cause the cross reference to be
displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I have a document I want to be sure references for Appendix alpha-#, or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have
several
chapters to do this in. How to do? I do NOT want the actual caption
on
the
figure or table to pick up the italization but I want thses to retain
their
figure or table title syles. Thanks
--
Janet A.




  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Find Replace references from whatever they were to italics

Looks like I forgot to paste in the code for dealing with the Exhibit and
Appendix.

Here it is:

Dim FindText As Variant, i As Long
FindText = Split("Exhibit/Appendix", "/")
For i = 0 To UBound(FindText)
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=FindText(i), Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=False) =
True
With Selection
.Font.Italic = True
.Collapse wdCollapseEnd
.MoveRight wdCharacter, 1
End With
Loop
End With
Next i

The reason that you are getting the errors on the other code is because in
the code that you posted, there is the word Then missing from the end of the
first line and the word True from the end of the second line. I am not sure
where they went to as they are included in the code at the bottom of this
message.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
Doug,

I put this in my normal.dotx in 2007 but it shows 2 read lines in the
center"V" where I've put xxx's. How to fix? THANK YOU ALL.

' ChangetoItalic Macro
'
Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
xxx If UCase(.Characters(i)) = "R"
xxx .Characters(i).Font.Italic =
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With V"
--
Janet A.


"Doug Robbins - Word MVP" wrote:

The following code should take care of that.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in message
...
I think this will work for the tables and figures, but the exhibits and
appendices are not put in with captioning and are not fields. I think
I
need
a simple Find and Replace for these but I don't know what it is? Does
anyone
know?
--
Janet A.


"Doug Robbins - Word MVP" wrote:

Use a macro containing the following code to add the \* charformat
switch
to
each of the cross reference fields and apply the Italic formatting to
the
first letter of the field code which will cause the cross reference to
be
displayed in Italic font:

Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
If UCase(.Characters(i)) = "R" Then
.Characters(i).Font.Italic = True
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Janet A. Thompson" wrote in
message
...
I have a document I want to be sure references for Appendix alpha-#,
or
Exhibit #-#, or Table #-# or Figure #-# are italicized. And I have
several
chapters to do this in. How to do? I do NOT want the actual
caption
on
the
figure or table to pick up the italization but I want thses to
retain
their
figure or table title syles. Thanks
--
Janet A.





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
Can't find the italics form of my font V Microsoft Word Help 2 April 11th 08 07:29 AM
Find and Replace Italics rebinnola New Users 1 October 18th 07 01:24 AM
replace underline with italics rgb Microsoft Word Help 2 September 10th 06 12:38 AM
Is there a way to replace italics with underscores? A CO in CO Microsoft Word Help 2 August 20th 06 04:24 AM
Should be simple! Macro to find italics won't run LizW Microsoft Word Help 2 November 30th 04 06:32 PM


All times are GMT +1. The time now is 01:22 PM.

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"