Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the name o an open Word document

Status
Not open for further replies.

nochoice

Programmer
Jun 17, 2003
72
CA
Hey everybody,

I open a document (doc1.doc) using the file open command (like clicking with my mouse no code), I then click a button in doc1.doc, and it opens a new document (doc2.doc). How do I find the name of doc1.doc? The reason is, I need to pass the value of a checkbox from doc1.doc to doc2.doc.
 
Hi,
In the Documents collection is the name of all opened documents. The document that you are in is called ActiveDocument. So...
Code:
For Each doc in Documents
   If Doc.Name <> ActiveDocument.Name Then
      'Doc is the other document 
   End If
Next
Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top