Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Conversions / November 2006

Tip: Looking for answers? Try searching our database.

How do I find out what version of Word a document was created in?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stretchcoder - 28 Nov 2006 16:59 GMT
I want to do this programatically, but I can't seem to find the appropriate
property or method in the Object model.

I can get the document creator, which is MSWD (and doesn't help) and the
wdSaveFormat is wdFormatDocument, (which also doesn't help)

My end goal is to check if a file is in the 97 file format so I don't try to
do things to it that can't be done in 97 but are fine in 2003.

Any suggestions?

I'm using Visual C++ and late binding, not that it matters... I would be
happy to even see VB code!
Tony Jollans - 28 Nov 2006 17:25 GMT
In general you can use Application.Version to get the version of Word, but
in particular, you can use the compiler constant VBA6 - it is true if you
have VBA version 6 or later and false otherwise. VBA 6 shipped with Word
2000.

Signature

Enjoy,
Tony

>I want to do this programatically, but I can't seem to find the appropriate
> property or method in the Object model.
[quoted text clipped - 10 lines]
> I'm using Visual C++ and late binding, not that it matters... I would be
> happy to even see VB code!
Stretchcoder - 28 Nov 2006 17:53 GMT
This would work if I were early binding and just using one version of Word.  
However, my app late binds so that I can use whatever version of Word is
installed on the user's PC.

So what I really need is to find the _file_ version info, regardless of what
version of Word I am using...

Thanks!

> In general you can use Application.Version to get the version of Word, but
> in particular, you can use the compiler constant VBA6 - it is true if you
[quoted text clipped - 15 lines]
> > I'm using Visual C++ and late binding, not that it matters... I would be
> > happy to even see VB code!
Tony Jollans - 28 Nov 2006 18:32 GMT
My apologies; I misread your question. However I'm not clear what you want
to know.

The things you can *do* are constrained by the version of Word you are
running under not the version of Word the document was originally written
from.

If it helps, the basic file format has not changed since Word 97 (at least
not until Word 2007) and Word 97 should be able to open documents written in
earlier versions although some features may not be available and some
information may be lost if a document from, say, 2003 is saved in 97.

Signature

Enjoy,
Tony

> This would work if I were early binding and just using one version of
> Word.
[quoted text clipped - 31 lines]
>> > be
>> > happy to even see VB code!
Stretchcoder - 28 Nov 2006 19:11 GMT
Tony,

I am trying to apply encryption to a Word document... in documents that were
created in 97 I need to use the Office 97 compatible password protect instead
of something stronger, even if the current version of Word I am working with
is a later verision.

So I need to know what version of Word a doc was created in, regardless of
what's currently installed on the user's PC...

> My apologies; I misread your question. However I'm not clear what you want
> to know.
[quoted text clipped - 43 lines]
> >> > be
> >> > happy to even see VB code!
Tony Jollans - 29 Nov 2006 08:27 GMT
I don't believe there's any way to tell for sure without rooting in the
binary. The Built-in "Application" Property does, I believe, have different
strings representing the name of the Word version (probably the one which
last saved it) but I don't know what they all are off the top of my head and
it is user-changeable so no guarantees. Regardless of the version which
wrote the document, of course, there is the option to disable features
introduced later - see DisableFeatures, DisableFeaturesIntroducedAfter, and
OptimizeForWord97 options.

Signature

Enjoy,
Tony

> Tony,
>
[quoted text clipped - 64 lines]
>> >> > be
>> >> > happy to even see VB code!
Klaus Linke - 30 Nov 2006 17:07 GMT
Aren't the compatibility options set automatically to those "preferred" for
the version that last saved that document?

Checking them would admittedly be a sort of backhanded approach, but I don't
know of any other way either.

Regards,
Klaus

>I don't believe there's any way to tell for sure without rooting in the
>binary. The Built-in "Application" Property does, I believe, have different
[quoted text clipped - 78 lines]
>>> >> > be
>>> >> > happy to even see VB code!
Tony Jollans - 30 Nov 2006 18:58 GMT
Interesting - if I understand you correctly I hadn't realised that, but what
I meant was that you can, in Word 2003, explicitly disable features
introduced later than Word 97. Finding out that Word 2003 wrote the document
is not helpful in determining that it is - and, perhaps, should remain -
Word-97 compatible.

Signature

Enjoy,
Tony

> Aren't the compatibility options set automatically to those "preferred"
> for the version that last saved that document?
[quoted text clipped - 87 lines]
>>>> >> > be
>>>> >> > happy to even see VB code!
Klaus Linke - 30 Nov 2006 21:51 GMT
>> Aren't the compatibility options set automatically to those "preferred"
>> for the version that last saved that document?

That was put wrong. In my experience if say Word 2000 created a document,
and it is then edited in a newer version, the compatibility options are set
to the set "recommended for Word 2000", and stay like that even if saved in
the newer versions, unless a user explicitly changes (some of) them.
And the question was not rethorical, I'm really not sure about it. It's just
the way I seem to observe it.

> Interesting - if I understand you correctly I hadn't realised that, but
> what I meant was that you can, in Word 2003, explicitly disable features
> introduced later than Word 97.

Yes.

> Finding out that Word 2003 wrote the document is not helpful in
> determining that it is - and, perhaps, should remain - Word-97 compatible.

Yes, you were absolutely right, and I too think that this is the most useful
feature to help Stretchcoder.

I was just thinking loud how you could determine which older version
actually wrote the document. Not sure whether it's even actually stored in
the document and just not visible in the interface (and to VBA, unless we
both missed something).

With RTF, the version would (only) be implicit in the version of RTF written
(which increased with each Word version), I think. In the XML I've looked
at, I do not remember seeing any version info... and it might well not be
present explicitly in the binary DOC format either.

Klaus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.