2003 best Help for dim OOP-er

J

Jim Shores

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)

?
 
J

Jonathan West

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
 

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