Does there appear to be some reason why this code returns a No.

4160, 'bad file name' error:

Set docCurrentDocument = Documents(strFileName)

or

Documents(strFileName).BuiltInDocumentProperties(wdPropertyAuthor)

where strFileName looks perfect, returned from:

strFileName = Application.FileSearch.FoundFiles(index)

?
--
Jim Shores

Re: 2003 best Help for dim OOP-er by Jonathan

Jonathan
Wed Jul 07 07:14:53 CDT 2004

Hi Jim

The Documents collection is a collection of open documents. Therefore you
have to open the document first using this method

Documents.Open Filename:=strFileName


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

"Jim Shores" <JimShores@discussions.microsoft.com> wrote in message
news:B45A34E5-8AA6-4CFD-AC81-62D55DD5EFCE@microsoft.com...
> Does there appear to be some reason why this code returns a No.
>
> 4160, 'bad file name' error:
>
> Set docCurrentDocument = Documents(strFileName)
>
> or
>
> Documents(strFileName).BuiltInDocumentProperties(wdPropertyAuthor)
>
> where strFileName looks perfect, returned from:
>
> strFileName = Application.FileSearch.FoundFiles(index)
>
> ?
> --
> Jim Shores