Check if a MS-Word file is already opened

I'm automating MS Word from VB6. I want to check if a document is already opened by another instance of Word (on the same or different computer). On my machine each time i open a word doc a hidden file is created:  "~$filename.doc", so i can check for excistence of this file. is this the same for all MS word versions and settings, or is a better procedure available for this check.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try this

Open "yourfullpath file.doc" For Binary Access Read Lock Read As #1

Error will occur if file is opened by word

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
m_wendyAuthor Commented:
Ok this the first step, but i also want to be able to open the file in read-only mode if another user also has the file open in Read-only mode...
IF you want to open the word doc, you should use word automation


Wrdapp.Documents.Open FileName:="your odc.doc", ConfirmConversions:=False, _

where Wrdapp is word.application

The OS allows only 1 people open for write but no limitiation for people open for read only.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

m_wendyAuthor Commented:
i know that i have to use automation... but i want to check the file before it is opened...
Use my first comment
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from m_wendy from 12/19/2003 comment
Award points to EDDYKT is recommend.
Please leave any comments here within the next seven days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.