Hi Michael,
whoops! Looks like something got "lost in translation". I
did some editing to make sure it wouldn't break in the
wrong place due to wrapping, and it looks like I deleted
something I ought not have! Sorry about that. Try this
Sub InsertXEfield()
Dim szEntry As String
szEntry = Selection.Range.Text
Selection.Collapse wdCollapseEnd
ActiveDocument.Fields.Add _
Range:=Selection.Range, _
Type:=wdFieldEmpty, _
Text:=" XE " & Chr$(34) & _
szEntry & Chr$(34) & " /f" _
& Chr$(34) & "a" & Chr$(34), _
PreserveFormatting:=False
End Sub
> I tried copying and pasting this into a
> Macro and wasn't able to get it to work. I don't have
> any background in programming so am not able to debug
> it. But I can tell you that when I pasted it everything
> from "ActiveDocument.Fields.Add _" and on was red. Any
> help you could give me would be most appreciated.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
Michael - 11 Feb 2004 22:31 GMT
Brilliant!
Thank you very much!
Michael
>-----Original Message-----
>Hi Michael,
[quoted text clipped - 35 lines]
>
>.