Hi,

Does anyone know if there is a way to convert text into field codes?

John

Re: Converting text to field codes by Greg

Greg
Tue May 23 06:35:43 CDT 2006

I don't know how much utility you can achieve with this, but I suppose
you could do it with a macro. Select the text and run:

Sub Scratchmacro()
Dim oRng As Word.Range
Dim pText As String
Set oRng = Selection.Range
pText = oRng.Text
oRng.Delete
oRng.Fields.Add oRng, wdFieldEmpty, pText
End Sub


Re: Converting text to field codes by Charles

Charles
Tue May 23 08:16:15 CDT 2006

Select the text.
Press Ctrl-F9
Press F9

The following does this after you've selected the text but I don't know that
it is any easier to use than the function keys:
Sub ChangeToField()
'
' Macro recorded 5/23/2006 by Charles Kyle Kenyon
'
Selection.Fields.Add _
Range:=Selection.Range, _
Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.Fields.Update
End Sub

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"JohnA" <JohnA@discussions.microsoft.com> wrote in message
news:B42409A1-7232-4AC1-92C2-22B2EF018EFE@microsoft.com...
> Hi,
>
> Does anyone know if there is a way to convert text into field codes?
>
> John