Advanced Find and Replace in Microsoft Word.docx

上传人:b****2 文档编号:23023509 上传时间:2023-04-30 格式:DOCX 页数:35 大小:35.03KB
下载 相关 举报
Advanced Find and Replace in Microsoft Word.docx_第1页
第1页 / 共35页
Advanced Find and Replace in Microsoft Word.docx_第2页
第2页 / 共35页
Advanced Find and Replace in Microsoft Word.docx_第3页
第3页 / 共35页
Advanced Find and Replace in Microsoft Word.docx_第4页
第4页 / 共35页
Advanced Find and Replace in Microsoft Word.docx_第5页
第5页 / 共35页
点击查看更多>>
下载资源
资源描述

Advanced Find and Replace in Microsoft Word.docx

《Advanced Find and Replace in Microsoft Word.docx》由会员分享,可在线阅读,更多相关《Advanced Find and Replace in Microsoft Word.docx(35页珍藏版)》请在冰豆网上搜索。

Advanced Find and Replace in Microsoft Word.docx

AdvancedFindandReplaceinMicrosoftWord

AdvancedFindandReplaceinMicrosoftWord

JackM.Lyon

©2002bytheEditorium.Allrightsreserved.

Contents

Preface3

SearchingwithCodes4

MicrosoftWord’sBuilt-inCodes4

SearchingforSpecialCharacters5

ANSICharacterCodes6

What’sThatCharacter?

7

Replacingwith“FindWhatText”8

Example:

FormattingNoteNumbers8

UsingWildcards10

TheBasics10

WildcardCombinations11

WildcardRanges13

WildcardGrouping14

Usingthe“FindWhatExpression”Wildcard16

WildcardsintheRealWorld18

Example118

Example219

Example319

Two-StepSearching20

Step120

Step221

Reference22

Preface

Thisdocumentisacompilationofarticlesthatoriginallyappearedinmyemailnewsletter,EditoriumUpdate.MicrosoftWord’sadvancedsearchfeaturesareextremelypowerful,butthey’realsovirtuallyundocumented.Mostexplanationsoftheirusehavebeenlimitedtoasimpletableofvariouswildcards.Iwrotethesearticlestoremedythatsituation.

Asyoureadthesearticles,youmaywanttoactuallytrythetechniquesinMicrosoftWord,usingsomejunkdocumentsthatyounolongerneed.Doingsowillhelpyoulearnmorethanjustreadingtheinstructions.

IhopethesearticleswillhelpyouunderstandhowusefulWord’sadvancedsearchfeaturescanbeandhowmuchtimetheycansaveyou.Usingthesefeatures,youcanquicklyfixrepetitiveproblemsthatwouldtakehourstocorrectbyhand.

Enjoy!

SearchingwithCodes

Whyshouldyou,asaneditor,writer,orpublisher,careaboutsomethingas“technical”assearchingwithcodes?

Becausetheymakeitpossibletofindandreplacethingsyouordinarilycouldn’t,suchasparagraphbreaks,dashes,andsymbols.Thiscanbeabighelpincleaningupallkindsofeditorialandtypographicalproblemsthatyou’dotherwisehavetofixbyhand.

Thereareactuallytwodifferentkindsofcodes:

1.MicrosoftWord’sbuilt-incodes(suchas^pforparagraphbreaksand^tfortabs).

2.ANSIcharactercodes(suchas^013forparagraphbreaksand^009fortabs).

Bothkindsofcodesareuseful,butthelistofANSIcodesincludeseverycharacter(notincludingUnicodecharacters)youcanuseinMicrosoftWord.LaterI’llprovidealistofthesecodesandexplainhowtousethem.

MicrosoftWord’sBuilt-inCodes

First,I’llgiveyoualistofWord’sbuilt-incodes,whichyoucanuseinMicrosoftWord’sFindandReplacedialog(Edit/Replace).Forexample,ifyouwantedtofindanem dash,you’denterthefollowingcodeinthe“Findwhat”box:

^+

Toreplaceitwithanen dash,you’denterthisinthe“Replacewith”box:

^=

YoucanalsoinsertWord’sbuilt-incodesbyclickingtheSpecialbuttonintheFindandReplacedialogandthenselectingtheitemyouneed.Pleasenotethatyoucanusesomeofthecodesonlyinfindingtext,othersonlyinreplacing,andothersineitherone.

Youcanalsousecombinationsofcodes.Forexample,youcouldsearchfortabsfollowedbyparagraphbreaks(^t^p)andreplacethemwithparagraphbreaksalone(^p).

Andnow,here’sthelist.

Note

Foreasyreference,allthecodelistsarealsoincludedattheendofthisdocument.

CodesYouCanUseinthe

“FindWhat”and“ReplaceWith”Boxes

Character

Find

What

ReplaceWith

AnnotationMark(comment)

^a

Anycharacter

^?

Anydigit

^#

Anyletter

^$

Caretcharacter

^^

^^

Clipboardcontents

^c

Columnbreak

^n

^n

ContentsoftheFindWhatbox

^&

Emdash

^+

^+

Endash

^=

^=

Endnotemark

^e

Field

^d

Footnotemark

^f

Graphic

^g

Linebreak

^l

^l

Manualpagebreak

^m

^m

Nonbreakinghyphen

^~

^~

Nonbreakingspace

^s

^s

Optionalhyphen

^-

^-

Paragraphmark

^p

^p

Sectionbreak

^b

Tabcharacter

^t

^t

Whitespace

^w

SearchingforSpecialCharacters

AsIsaidabove,MicrosoftWordhasANSIcharactercodesyoucanusetofindcertainitemsthatarenotusuallyvisibleinthetext:

•Foracarriagereturn,youcanuse^013.

•Forasectionbreak,youcanuse^012.

•Forawordspace,youcanuse^032.

Ofcourse,youcanalsouseWord’sbuilt-incodesfromthetableabove,whichyoucaninsertintotheFinddialog’s“Findwhat”boxbyclickingthe“Special”button:

•Foracarriagereturn,youcanuse^p.

•Forasectionbreak,youcanuse^b.

•Forawordspace,youcanuse^w

(actually,anywhitespace).

Sowhywouldyouwanttousethefirstcodes?

Becauseifyou’refindingsomethingbyusingwildcards,thesecondoneswon’twork.Forexample,let’ssaythat(forsomereason)you’researchingfor“wh”followedbyanyothercharacter(thewildcardforwhichis“?

”),followedbyacarriagereturn.IntheFinddialog’s“Findwhat”box,youenterthis:

wh?

^p

AndtomakeWordsearchforthewildcardratherthananactualquestionmark,youputacheckintheboxlabeled“Usewildcards.”

Finally,youclicktheFindbutton.Whathappens?

Yougetanerrormessage:

^pisnotavalidspecialcharacterfortheFindWhatboxorisnotsupportedwhentheUseWildcardscheckboxisselected.

“Wellthen,how,”youpolitelyaskyourcomputer,“amIsupposedtofindwhatI’mlookingfor?

”Asusual,itdoesn’treply,buthere’stheansweranyway.Inthe“Findwhat”box,youenterthis:

wh?

^013

Andthatwilldothejob.(OnaPC.OnaMacintosh,usingnumericcodesmaynotworkwhenusingwildcards.Here’salittletrick,however.Tryenclosingthecodeinsquarebrackets,andprecedethecodewithabackslash.Forexample,tofindacarriagereturnonaMac,tryusing[\^013].)

Ordinarily,youshouldprobablyuseWord’sbuilt-incodes,suchas^pand^b.Butwhenthosedon’twork,nowyou’vegotanalternative.

ANSICharacterCodes

Youcanalsosearchforanycharactersusingnumericcharactercodes(technicallyANSInumbers).I’mincludingthelistattheendofthisdocument,withcodesforbothPCandMacintosh,althoughImakenoguaranteesabouthowthecharactersthemselveswillshowup.

Also,you’llnoticethatIhaven’tincludedthecodesforsuchordinarycharactersaslettersofthealphabet,sinceyoucansearchforthesebyusingthecharactersthemselves.Nocodeisneeded.

Tousethecodesforfindingorreplacingspecialcharacters,simplyinsertthem,precededbyacaretandazero,inthe“Findwhat”or“Replacewith”boxesinMicrosoftWord’sFindandReplacedialogbox.

Forexample,ifyouwantedtofindauwithanumlaut,you’denterthefollowingcodeinthe“Findwhat”boxonaPC:

^0252OnaMacintosh,you’denterthis:

^0159

Youcanalsousemanyofthecodestoinsertspecialcharactersintoyourdocuments.Todoso:

1.TurnonNumLockforthenumerickeypad.

2.HolddowntheALTkey.

3.Onthenumerickeypad,typeazerofollowedbythecode.

4.ReleasetheALTkey.

Thecharacterwillbeinsertedintoyourdocument.

WARNING:

Usenumericcodestoreplaceparagraphreturnsandsectionbreaksonlywhenabsolutelynecessary,becauseWordstoresformattinginformationinthesecharacters.TrytosticktoWord’sbuilt-incodeswhenyoucan.Also,beawarethatsomefontsassigndifferentcharacterstothenumericcodes.ThelistbelowshouldbeaccurateforTimesNewRomanonaPCandTimesonaMacintosh.

What’sThatCharacter?

Butwhatifyou’retryingtofindandreplacesomeobscurecharacterinanunusualfont?

Here'sthescenario:

Youopenagiantdocumentfromaclientandstartlookingthroughit.Butwhat'sthis?

Thesameoddcharacteratthebeginningofeveryparagraph.Mustbesomekindoffiletranslationerror.Odderstill,MicrosoftWordwon'tletyoupastethecharacterintoitsFindandReplacedialog,sohowareyougoingtogetridofthemall?

Byhand?

Horrors!

Ifyouknewthecharacter'snumericcode,youcouldsearchforit.Butthischaracterisn'tontheusuallist.Howcanyoufindoutitsnumericcode?

ByusingourtrustyNextCharactermacro:

ForMicrosoftWord6or7(95):

'Macrostartshere

NextChar$=Str$(Asc(Selection$()))

MsgBox"Thecodeforthenextcharacteris"\+NextChar$+".","NextCharacter"

'Macroendshere

ForMicrosoftWord8(97or98)

or9(2000or2001)

'Macrostartshere

DimNextChar$

NextChar$=Str(Asc(WordBasic.[Selection$]()))

WordBasic.MsgBox_"Thecodeforthenextcharacteris"+NextChar$+".",_"NextCharacter"

'Macroendshere

ToCreatetheMacro

1.Copytheappropriatemacrofromthisnewsletter.

2.Clickthe"Tools"menuatthetopofyourWordwindow.

3.Click"Macro."

4.InWord97,98,2000,or2001,click"Macros."

5.Makesure"MacrosAvailableIn"shows"Normal.dot."

6.Typeanameforthemacrointhe"MacroName"box--"NextCharacter"shoulddonicely.

7.Click"Create."

8.Pastethemacroatthecurrentinsertionpoint.

9.InWord6or7,click"File,"then"Close,"then"Yes."InWord97,98,2000,or2001,click"File,"then"CloseandReturntoMicrosoftWord."

ToRuntheMacro:

1.Putyourcursorinfrontofthecharacterwhosenumericcodeyouwanttoknow.

2.Clickthe"Tools"menuatthetopofyourWordwindow.

3.Click"Macro."

4.InWord97,98,2000,or2001,click"Macros."

5.Makesure"MacrosAvailableIn"shows"Normal.dot."

6.Selectthemacro(probably"NextCharacter")inthe"MacroName"box.

7.Click"Run."

Afteryourunthemacro,amessageboxwillappearonyourscreenwiththenumericcodeyouneed.

Replacingwith“FindWhatText”

Ifyou’refacedwithacomplextaskusingMicrosoftWord’sFindandReplacefeature,the“FindWhatText”replacementcodemaycomeinhandy.Forexample,let’ssayyouneedtoaddtheHTMLitalictagsandaroundanythingformattedwithitalic.(Ifyoudon’tunderstandHTML,don’tworry.You’llsoonseethepointofthisexample.)Youmightthinkyou’dneedamacrotoaddthetags,butyoudon’t.Youcaneasilyd

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 教学研究 > 教学计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1