How to determine what file formats are supported

J

Jason Lawrence

The goal is to determine what file types the user can save as in Office 2007
and Office 2003. This comes up because in Office 2003 the user can have
installed the compatibility pack to save as 2007 documents and in Office 2007
(SP1) they can install add-ins to save as XPS, PDF or both. Is there a way
to query through the OOM what file types are supported? Or failing that, a
way to determine if those add-ins/compatibility packs have been installed?

Thanks,
Jason
 
M

macropod

Hi Jason,

You can loop through the converters collection to see if the one you require is present:

Sub Test()
Dim oConv As FileConverter
For Each oConv In FileConverters
MsgBox oConv.FormatName
Next
End Sub
 
J

Jay Freedman

On Wed, 28 Oct 2009 08:54:06 -0700, Jason Lawrence <Jason
The goal is to determine what file types the user can save as in Office 2007
and Office 2003. This comes up because in Office 2003 the user can have
installed the compatibility pack to save as 2007 documents and in Office 2007
(SP1) they can install add-ins to save as XPS, PDF or both. Is there a way
to query through the OOM what file types are supported? Or failing that, a
way to determine if those add-ins/compatibility packs have been installed?

Thanks,
Jason

Look at the VBA help topic on the FileConverters collection object.
Modifying the example there, this will tell you if the compatibility
pack is installed in Word 2003:

Private Function Is2007Compat() As Boolean
Dim rslt As Boolean
Dim conv As FileConverter
rslt = False
For Each conv In FileConverters
If conv.FormatName = "Word 2007 Document" Then
rslt = True
Exit For
End If
Next
Is2007Compat = rslt
End Function

Sub demo()
Dim msg As String
msg = "The Office 2007 compatibility pack is "
If Not Is2007Compat Then msg = msg & "not "
msg = msg & "installed."
MsgBox msg
End Sub

Unfortunately, Word 2007 isn't so forthcoming about its capabilities.
The complete list of converters in 2007 is

Works 6.0 - 9.0
Word 97-2003 & 6.0/95 - RTF
Recover Text from Any File
WordPerfect 6.x
WordPerfect 5.x
Works 6 - 9 Document

Not only is there not a specific converter for PDF or XPS, but there's
no separate converter for Word 97-2003 *.doc format.
 

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