Document(#) vs Document("Name") 
Author Message
 Document(#) vs Document("Name")

Good morning Paul,

The index or the name is used to access the item in the
Documents Collection. If you have the name (which you
normally would) you don't need the index. Its usually
preferable to use the name anyway because the docs in the
collection are in no particular order (that I'm aware of)
and because of that using the index won't always return
the same document.

If there is some reason why you need the index then set up
a for loop which look for the name of each doc --
something like this:

dim i as integer

For i=1 to Documents.Count

next i

>-----Original Message-----
>You can refer to documents by either index number
>(Documents(3)) or name (Documents("Doc3.doc")).  Given an
>index, I know how to figure out the document's name, but,
>given a name, how do you figure out the document's index

>Any thoughts?



Sun, 21 Nov 2004 03:51:17 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Document(#) vs Document("Name")

2. "Ask" field and protecting a document

3. word 2000 hangs at ""

4. Using "new document" dialog

5. "View Only" document

6. "Could not change document template."

7. "Frozen" Document on Open

8. "Reading" text from a Word document

9. Automatically "Save As..." upon opening document

10. Error 462 "Documents.Add"

11. Ref "This Document" NOT the ACTIVEDOCUMENT

12. Referencing "This Document" in code


Powered by phpBB® Forum Software