Macro to Replace Formatting in Word 2000

W

Wayne McCaul

Hi there,

We need a macro that will swap out italic or bold in 2000 and replace it
with the word and code. So it would search for all italic words, when it
found one, it would remove the italics and then add code to each end of it.

For example:

[Italic] Boy would go to [Plain Text] <i>Boy</i>

But we would need to designate the opening and closing codes (this isn't for
HTML, but it's an easy example).

Does a macro exist? Is it possible to create someting like that?

Thanks,

-w
 
G

Graham Mayor

You don't need a macro for that. Replace will do it easily
With the cursor in the find box Click CTRL+I - it will show Format - Font
Italic
With the cursor in the Replace with box Click CTRL+I twice and it will show
Format Font - Not Italic
In that box put <i>^&<\i>
replace all.
You can use the same procedure for bold - only this time it is CTRL+B to
cycle through the bold options.
 
W

Wayne McCaul

LOL! Talk about overthinking the problem!
Thanks!

Now, can I do something similar to keep tables?


Graham Mayor said:
You don't need a macro for that. Replace will do it easily
With the cursor in the find box Click CTRL+I - it will show Format - Font
Italic
With the cursor in the Replace with box Click CTRL+I twice and it will show
Format Font - Not Italic
In that box put <i>^&<\i>
replace all.
You can use the same procedure for bold - only this time it is CTRL+B to
cycle through the bold options.


Wayne said:
Hi there,

We need a macro that will swap out italic or bold in 2000 and replace
it with the word and code. So it would search for all italic words,
when it found one, it would remove the italics and then add code to
each end of it.

For example:

[Italic] Boy would go to [Plain Text] <i>Boy</i>

But we would need to designate the opening and closing codes (this
isn't for HTML, but it's an easy example).

Does a macro exist? Is it possible to create someting like that?

Thanks,

-w
 
G

Graham Mayor

What do you want to do with tables?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Wayne said:
LOL! Talk about overthinking the problem!
Thanks!

Now, can I do something similar to keep tables?


Graham Mayor said:
You don't need a macro for that. Replace will do it easily
With the cursor in the find box Click CTRL+I - it will show Format -
Font Italic
With the cursor in the Replace with box Click CTRL+I twice and it
will show Format Font - Not Italic
In that box put <i>^&<\i>
replace all.
You can use the same procedure for bold - only this time it is
CTRL+B to cycle through the bold options.


Wayne said:
Hi there,

We need a macro that will swap out italic or bold in 2000 and
replace
it with the word and code. So it would search for all italic words,
when it found one, it would remove the italics and then add code to
each end of it.

For example:

[Italic] Boy would go to [Plain Text] <i>Boy</i>

But we would need to designate the opening and closing codes (this
isn't for HTML, but it's an easy example).

Does a macro exist? Is it possible to create someting like that?

Thanks,

-w
 
W

Wayne McCaul

Okay, here's our problem.

We import text to Ventura. Upgrading to XP has cause some problems, and we
have to use TXT files now. This drops out formatting, which we can now
correct (thankyouverymuch).

But our texts usually have tables as well. This is further formatting that
will get stripped out on the conversion. Any ideas?

Thanks,

-W

Graham Mayor said:
What do you want to do with tables?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Wayne said:
LOL! Talk about overthinking the problem!
Thanks!

Now, can I do something similar to keep tables?


Graham Mayor said:
You don't need a macro for that. Replace will do it easily
With the cursor in the find box Click CTRL+I - it will show Format -
Font Italic
With the cursor in the Replace with box Click CTRL+I twice and it
will show Format Font - Not Italic
In that box put <i>^&<\i>
replace all.
You can use the same procedure for bold - only this time it is
CTRL+B to cycle through the bold options.


Wayne McCaul wrote:
Hi there,

We need a macro that will swap out italic or bold in 2000 and
replace
it with the word and code. So it would search for all italic words,
when it found one, it would remove the italics and then add code to
each end of it.

For example:

[Italic] Boy would go to [Plain Text] <i>Boy</i>

But we would need to designate the opening and closing codes (this
isn't for HTML, but it's an easy example).

Does a macro exist? Is it possible to create someting like that?

Thanks,

-w
 
G

Graham Mayor

You can't have tables in text files as you probably appreciate.
Have you tried setting the compatibility options in Word > tools > options
to set the options for the version of Word that worked?
Have you tried saving the document as RTF which will retain the tables and
produce a file format with wider acceptability?
How about Word Perfect format? You'll probably need the old converter which
is linked from my web site to save in WP format.
If you comment "(thankyouverymuch)" was aimed at the users of this group,
then note that we don't work for Microsoft - we are simply users like
yourself.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Wayne said:
Okay, here's our problem.

We import text to Ventura. Upgrading to XP has cause some problems,
and we have to use TXT files now. This drops out formatting, which we
can now correct (thankyouverymuch).

But our texts usually have tables as well. This is further formatting
that will get stripped out on the conversion. Any ideas?

Thanks,

-W

Graham Mayor said:
What do you want to do with tables?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Wayne said:
LOL! Talk about overthinking the problem!
Thanks!

Now, can I do something similar to keep tables?


:

You don't need a macro for that. Replace will do it easily
With the cursor in the find box Click CTRL+I - it will show Format
- Font Italic
With the cursor in the Replace with box Click CTRL+I twice and it
will show Format Font - Not Italic
In that box put <i>^&<\i>
replace all.
You can use the same procedure for bold - only this time it is
CTRL+B to cycle through the bold options.


Wayne McCaul wrote:
Hi there,

We need a macro that will swap out italic or bold in 2000 and
replace
it with the word and code. So it would search for all italic
words, when it found one, it would remove the italics and then
add code to each end of it.

For example:

[Italic] Boy would go to [Plain Text] <i>Boy</i>

But we would need to designate the opening and closing codes (this
isn't for HTML, but it's an easy example).

Does a macro exist? Is it possible to create someting like that?

Thanks,

-w
 
K

Klaus Linke

Hi Wayne,

For a macro that inserts very basic, HTML style table tags, see
http://groups.google.com/[email protected]

I'm not familiar with Ventura and its import capabilities. QuarkXPress and
InDesign have some special tagged file format, and if you know how tables
have to be tagged in that format, you could insert the proper tags.
If Ventura doesn't have any built-in support for tables, you might just
convert all tables to text (with tabs).
Since that's tedious work if you have many tables, you could also do this
by macro:

Dim myTable As Table
For Each myTable In ActiveDocument.Tables
myTable.ConvertToText _
Separator:=wdSeparateByTabs, _
NestedTables:=True
Next myTable

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top