Getting the version of Word used to create a document (C#)

automation , cpp , word Manchester, United States
  • 12 years ago
    Is there any way to programmatically get the version of Word used to create a given document? I need to automate this, as I'm dealing with thousands of folders. I tried using Word._Document oDoc = oWord.Documents.Open(ref oFileName, ref oMissing, ref readOnly, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref isVisible, ref oMissing, ref oMissing, ref oMissing, ref oMissing); string version = oDoc.Versions.Application.Version;, but this seems to return the version of Word being used locally to open the files on the computer running the program I am working on.
  • 12 years ago
    Hi Rob - welcome to developerFusion! I'm afraid I don't think it's possible to reliably do this within VBA. However, it does appear to be present in the binary file itself; [http://word.tips.net/Pages/T000601_Determining_Word_Versions_of_Documents.html](http://word.tips.net/Pages/T000601_Determining_Word_Versions_of_Documents.html) So you might be able to do some digging prior to opening the document using the VBA bits? Hope that helps.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann