Re: Controlling/Replacing Avaiable Styles

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: ML (ml_at_schoonersolutions.com)
Date: 02/15/05


Date: Tue, 15 Feb 2005 14:49:59 -0400

Thanks. Do you happen to have a sample of code for doing such a replace on
styles?

This sounds like it should work. Both the numbered and unnumbered styles
are defined in the document so if I can do a macro that replaces A->B then
this should work out.

I have for example "Heading 1 (UN)" and "Heading 1 (N)" and based on the
userform selection want to replace one with the other.

"Jonathan West" <jwest@mvps.org> wrote in message
news:%23Ssxk44EFHA.3636@TK2MSFTNGP09.phx.gbl...
>
> "ML" <ml@schoonersolutions.com> wrote in message
> news:%2310p%2314EFHA.2568@TK2MSFTNGP10.phx.gbl...
>> Thanks again.
>>
>>> You can use the Find object for this. Have the Text and Replacement.Text
>>> properties both set to empty strings, the Format property set to True,
>>> the .Style property set to the old style and the Replacement.Style
>>> property set to the new style.
>>
>> So doing is it possible somehow loop through an entire document and reset
>> the styles on every piece of text? I guess basically I need to do a find
>> and replace automatically on the entire document, replacing the old style
>> with the new style.
>
> Easier would be to do find-replace for each style, searching the entire
> document
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>



Relevant Pages

  • Re: Display a custom form modal
    ... repost and I'll ... Regards, ... Sir John Harvey-Jones "Jonathan West" wrote in message ... I have added a menu item in word that displays a>> custom form designed in vb. ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: How do I use a custom property as a field in my document?
    ... Unknown document property name" ... Regards, ... Stephenc ... > Jonathan West - Word MVP ...
    (microsoft.public.word.vba.general)
  • Re: Macro to Change sort and collapse groups in Mail folder
    ... Best regards ... Michael Bauer - MVP Outlook ... I did a lot of searching on the suggestion you gave me on line, ...
    (microsoft.public.outlook.program_vba)
  • Re: Printer Duplex
    ... Many thanks and best regards ... > method and before you set the duplex back single-sided. ... > Jonathan West - Word MVP ... >> But I use the code for the microsoft technet article on which is based ...
    (microsoft.public.word.vba.general)
  • Re: Reorder values in dynamicaly created WordBasic Listbox
    ... > Jonathan West - Word MVP ... >> Is it possible to easily reorder the values already in these listboxes. ...
    (microsoft.public.word.vba.userforms)