From: Ms D. on 19 Mar 2010 08:03 Thanks, that's great :) "Graham Mayor" wrote: > If you are extracting the text of the 10% of documents to a text file using > a macro, then the obvious solution would be to add the code to your macro to > convert the smart quotes to straight quotes before saving as TXT. The > original document need not be changed, nor would you need to change your > default quotes preference > > A code for swapping the quotes would be > > Dim vFindText As Variant > Dim vReplText As Variant > Dim sFormat As Boolean > Dim i As Long > sFormat = Options.AutoFormatAsYouTypeReplaceQuotes > vFindText = Array(Chr(147), Chr(148), Chr(145), Chr(146)) > vReplText = Array(Chr(34), Chr(34), Chr(39), Chr(39)) > Options.AutoFormatAsYouTypeReplaceQuotes = False > Selection.HomeKey wdStory > With Selection.Find > .Forward = True > .Wrap = wdFindContinue > .MatchWholeWord = True > .MatchWildcards = False > .MatchSoundsLike = False > .MatchAllWordForms = False > .Format = True > .MatchCase = True > For i = LBound(vFindText) To UBound(vFindText) > .Text = vFindText(i) > .Replacement.Text = vReplText(i) > .Execute Replace:=wdReplaceAll > Next i > End With > Options.AutoFormatAsYouTypeReplaceQuotes = sFormat > > http://www.gmayor.com/installing_macro.htm > > -- > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > Graham Mayor - Word MVP > > My web site www.gmayor.com > Word MVP web site http://word.mvps.org > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > > > > "Ms D." <Ms D.(a)discussions.microsoft.com> wrote in message > news:82F8941D-C9E0-41DE-B6A2-86953F6F14E5(a)microsoft.com... > > Is there any way I can turn off the 'AutoFormat as you Type' options for a > > single document, not for all Word documents? > > > > I work on a lot of documents in a day, and 90% need to have typographer's > > quotes. 10%, however, are used to create code, so need to have straight > > quotes. > > > > Ideally, I would like to be able to turn off the 'AutoFormat as You Type' > > options specifically for the 10% of documents, without this affecting the > > remaining 90% of my documents. If possible, I want to avoid having to > > remember to set the AutoFormat options every time I open a document. (I > > also > > want to avoid using a macro if possible, as the code in the 10% is > > extracted > > to a .txt file using a macro.) > > > > I'm aware that I can turn off AutoFormat options for *all* Word documents, > > or press CTRL+Z when typing, or do a Find and Replace when I'm done, > > etc... > > > > > > > . >
|
Pages: 1 Prev: How to alter the number of authors in a citation before 'et al Next: APA Style Citations |