Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't find the italics form of my font | Microsoft Word Help | |||
Find and Replace Italics | New Users | |||
replace underline with italics | Microsoft Word Help | |||
Is there a way to replace italics with underscores? | Microsoft Word Help | |||
Should be simple! Macro to find italics won't run | Microsoft Word Help |