"p0" <(E-Mail Removed)> wrote
>> Is there a way to capture the name of a Word document that I'm working
>> with
>> while the file is open and I'm in the file? By sending it to the
>> clipboard,
>> for example?
> The following macro might do the trick:
>
> ' === Begin of macro ===
> Sub FileName()
> Dim obj As DataObject
>
> Set obj = New DataObject
>
> obj.SetText ActiveDocument.Path & ActiveDocument.Name
> obj.PutInClipboard
> End Sub
> ' === End of macro ===
Thanks, Yves. This looks like it should do what I want but it chokes on the
first line (Dim obj) with a "User-defined type not identified" error. What
am I doing wrong?
--
Bob
http://www.kanyak.com