A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro to format part of Company name



 
 
Thread Tools Display Modes
  #1  
Old August 5th, 2009, 06:44 PM posted to microsoft.public.word.docmanagement
Marcia
external usenet poster
 
Posts: 46
Default 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  
Old August 5th, 2009, 07:30 PM posted to microsoft.public.word.docmanagement
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default 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  
Old August 7th, 2009, 02:23 AM posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default 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  
Old August 10th, 2009, 05:07 PM posted to microsoft.public.word.docmanagement
Marcia
external usenet poster
 
Posts: 46
Default 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  
Old August 10th, 2009, 05:08 PM posted to microsoft.public.word.docmanagement
Marcia
external usenet poster
 
Posts: 46
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.