Find the installed version of MS Word
-
I have a program that embeds Word through DsoFramer, but I need to know which version (2000/2003/XP/2007/2010) is installed because I need to adjust some things depending on the installed version. Does anyone know how to do that? I have a pointer to the CApplication interface, and I can probably get any interface that's needed.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
I have a program that embeds Word through DsoFramer, but I need to know which version (2000/2003/XP/2007/2010) is installed because I need to adjust some things depending on the installed version. Does anyone know how to do that? I have a pointer to the CApplication interface, and I can probably get any interface that's needed.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
If you can get the path to Word's executable you might try using GetFileVersionInfo[^], this is just an idea, am not sure if Word's executable(s) actually contain(s) this or not, but you can check.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
-
I have a program that embeds Word through DsoFramer, but I need to know which version (2000/2003/XP/2007/2010) is installed because I need to adjust some things depending on the installed version. Does anyone know how to do that? I have a pointer to the CApplication interface, and I can probably get any interface that's needed.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
I did find an article via Google some time ago which described it, but unfortunately I cannot remember how (maybe "office registry keys" or something). However if you look at a key similar to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration\{91130409-6000-11D3-8CFE-0150048383C9}
you can find the values. You may need to enumerate some of the keys looking for "Office" etc but it should not be too difficult.It's time for a new signature.
-
I have a program that embeds Word through DsoFramer, but I need to know which version (2000/2003/XP/2007/2010) is installed because I need to adjust some things depending on the installed version. Does anyone know how to do that? I have a pointer to the CApplication interface, and I can probably get any interface that's needed.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
There is 'Version' property on CApplication interface. Moreover, DsoFramer is no longer recommended or supported by Microsoft. It has several known issues with modern office applications.
Thank-you kindly. The following VBA code gives me word version as being 12 (when using office 2007)
Sub getWordVer()
Dim wordApp As ObjectSet wordApp = CreateObject("Word.Application") wordApp.Visible = True wordVer = wordApp.Version MsgBox ("Word version: " + Str(wordVer))
End Sub
modified on Friday, July 16, 2010 4:01 AM
-
There is 'Version' property on CApplication interface. Moreover, DsoFramer is no longer recommended or supported by Microsoft. It has several known issues with modern office applications.
Thanks, this seems the best solution. Can you tell me what the known issues are? I'd like to know to see if they will affect my project.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
Thanks, this seems the best solution. Can you tell me what the known issues are? I'd like to know to see if they will affect my project.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
as you know, DsoFramer appeared in msdn KB articles as a sample of OLE on office applications. Latest office applications are actually not meant to be embedded. DsoFramer was declared as dead and no longer available in msdn samples. One way to embedd office applications is to load them inside web browser control and do some registry modifications to force IE to embedd office applications. Still i think you will be missing some features like ribbon control in Office 2007 and 2010.
modified on Wednesday, July 21, 2010 10:41 AM