If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro to format part of Company name
I am trying to setup a macro to find and change part of the company name to
italics. For example, the company name is HotPotato; all one word, but Potato is supposed to be italicized. I have setup AutoText for when I type in the name myself, but many times, I receive a document from someone else in the company and need to ensure that the name is formatted correctly. So far I haven't been successful with any macros that I have tried. Any suggestions? IS there a better way to do this? I am using Office 2003; won't be switching to 2007 for a few months (probably run into this issue again). Thank you for any help you might be able to give me. -- marcia |
#2
|
|||
|
|||
Macro to format part of Company name
Sub ScratchMacro()
Dim oRng As Word.Range Set oRng = ActiveDocument.Range With oRng.Find .Text = "HotPotato" While .Execute oRng.MoveStart wdCharacter, 3 oRng.Font.Italic = True oRng.Collapse wdCollapseEnd Wend End With End Sub marcia wrote: I am trying to setup a macro to find and change part of the company name to italics. For example, the company name is HotPotato; all one word, but Potato is supposed to be italicized. I have setup AutoText for when I type in the name myself, but many times, I receive a document from someone else in the company and need to ensure that the name is formatted correctly. So far I haven't been successful with any macros that I have tried. Any suggestions? IS there a better way to do this? I am using Office 2003; won't be switching to 2007 for a few months (probably run into this issue again). Thank you for any help you might be able to give me. -- Greg Maxey - Word MVP My web site http://gregmaxey.mvps.org Word MVP web site http://word.mvps.org |
#3
|
|||
|
|||
Macro to format part of Company name
You might find it easier to add a formatted AutoCorrect entry.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "marcia" wrote in message news I am trying to setup a macro to find and change part of the company name to italics. For example, the company name is HotPotato; all one word, but Potato is supposed to be italicized. I have setup AutoText for when I type in the name myself, but many times, I receive a document from someone else in the company and need to ensure that the name is formatted correctly. So far I haven't been successful with any macros that I have tried. Any suggestions? IS there a better way to do this? I am using Office 2003; won't be switching to 2007 for a few months (probably run into this issue again). Thank you for any help you might be able to give me. -- marcia |
#4
|
|||
|
|||
Macro to format part of Company name
Thanks, this really helped.
-- marcia "Greg Maxey" wrote: Sub ScratchMacro() Dim oRng As Word.Range Set oRng = ActiveDocument.Range With oRng.Find .Text = "HotPotato" While .Execute oRng.MoveStart wdCharacter, 3 oRng.Font.Italic = True oRng.Collapse wdCollapseEnd Wend End With End Sub marcia wrote: I am trying to setup a macro to find and change part of the company name to italics. For example, the company name is HotPotato; all one word, but Potato is supposed to be italicized. I have setup AutoText for when I type in the name myself, but many times, I receive a document from someone else in the company and need to ensure that the name is formatted correctly. So far I haven't been successful with any macros that I have tried. Any suggestions? IS there a better way to do this? I am using Office 2003; won't be switching to 2007 for a few months (probably run into this issue again). Thank you for any help you might be able to give me. -- Greg Maxey - Word MVP My web site http://gregmaxey.mvps.org Word MVP web site http://word.mvps.org |
#5
|
|||
|
|||
Macro to format part of Company name
Thank you, I had already tried that but it didn't work on pages of text that
I had to pickup from someone else. It did work entries that I was typing. -- marcia "Suzanne S. Barnhill" wrote: You might find it easier to add a formatted AutoCorrect entry. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "marcia" wrote in message news I am trying to setup a macro to find and change part of the company name to italics. For example, the company name is HotPotato; all one word, but Potato is supposed to be italicized. I have setup AutoText for when I type in the name myself, but many times, I receive a document from someone else in the company and need to ensure that the name is formatted correctly. So far I haven't been successful with any macros that I have tried. Any suggestions? IS there a better way to do this? I am using Office 2003; won't be switching to 2007 for a few months (probably run into this issue again). Thank you for any help you might be able to give me. -- marcia |
Thread Tools | |
Display Modes | |
|
|