How to check whether a file is a valid word document or not?

S

sudhakar

I would like to know how i can check whether a particular file is a valid
Word Document or not.

I tried to read the "Application Name" atribute in the summary information
of file using ActiveDocument.BuiltInDocumentProperties collection. But it
always returns "Microsoft Word" even though i open a PPT or Excel file.

Please help me in addressing this issue.

Thanks a lot in advance.
 
J

Jonathan West

sudhakar said:
I would like to know how i can check whether a particular file is a valid
Word Document or not.

I tried to read the "Application Name" atribute in the summary information
of file using ActiveDocument.BuiltInDocumentProperties collection. But it
always returns "Microsoft Word" even though i open a PPT or Excel file.

Please help me in addressing this issue.

Thanks a lot in advance.

Take a look at this article

Getting access to the Document Properties of a Word file
http://www.word.mvps.org/FAQs/MacrosVBA/DSOFile.htm


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
H

Helmut Weber

Hi Sudhakar,
I would like to know how i can check whether a particular file is a valid
Word Document or not.

From where? From the operating system, before trying to open it?
From Word, before trying to open it?
I tried to read the "Application Name" atribute in the summary information
of file using ActiveDocument.BuiltInDocumentProperties collection.

With "activedocument" you are accessing a word document,
and you get the correct answer...

I wonder ...

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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