Remove fields problem with Equations

G

Guest

I am working with Word 2000.

I receive documents that contain field codes, hyperlinks and equations (done
in MathType). I need to make all the field codes straight text (this includes
the auto numbering that can be added to equations through MathType).

I select the entire doc (ctrl-a) and then apply ctrl-shift-F9 to "remove"
the field codes.
Once this is done, all the equations turn to graphics. This is a problem for
continuing to work with the equations in the file.

What is interesting is that Microsoft Help lists the following for
ctrl-shift F9:
Convert embedded objects into graphics: Press CTRL+SHIFT+F9.
Unlink a field: CTRL+SHIFT+F9.

Is there another way to unlink the fields? Going through and finding and
unlinking them one-by-one is not an option as there are sometimes too many
fields within a file to be unlinked one-by-one.

Thanks!
 
G

Greg Maxey

KAM,

You might try this macro:

Sub UnlinkAllFields()
Dim pRange As Word.Range
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Unlink
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub
 
G

Guest

Thanks for the quick response!
I tried it and it removed the fields, but it also converted the Equations to
graphics.

BUT here is the difference:

Using Ctrl-Shift-F9, I cannot recover the equations using Convert
Equations...OLE objects from MathType (using WORD 2000 only)

Using your macro allows for me to be able to run the Convert Equations...to
OLE objects and it converted them back to Mathtype.

Any other ideas so that I would not have to run the Convert Equations
piece...?
(I am putting something in place in our workflow that would require my users
to run the Convert Equations to OLE anyway, but I am not sure WHEN we would
run that and I cannot be sure that my users would run it again AFTER the
field cleanup.) I could also put the code to Convert Equations to OLE right
into the Unlink Fields module, but the Convert Equations can be quite time
consuming. We can get files with 100 or so equations.

Any other thoughts would be greatly appreciated.

Thanks!
Kathleen
 
G

Greg Maxey

Kathleen,

I am not sure I understand your question so please excuse me if my propose
solution is out to lunch.

I think you want to unlink field and leave fields of the the type { EMBED
...... } along. It will be slower, but maybe something like:
Sub UnlinkSomeFields()
Dim pRange As Word.Range
Dim oField As Field
For Each pRange In ActiveDocument.StoryRanges
Do
For Each oField In pRange.Fields
If Not InStr(oField.Code.Text, "EMBED") > 0 Then
oField.Unlink
End If
Next
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

Which should only unlink fields that "don't" have EMBED in the
field.code.text

HTH
 
G

Guest

YES! Excellent. On a quick try it seemed to do the trick.

I wanted to unlink all other fields - but did not want to touch the
equations (we still need to edit them in MathType). Back when I started
working on this, I was confused by the fact that Word saw the Equations as
fields, when I didn't see them that way. In fact, that really wasn't the
case, but I could not figure out how to differentiate them.

Thanks so much!
Kathleen
 

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