Getting a list of available Office Text Converters and their correspondingextensions

J

Jim Meyer

Hi,

I'm looking for a way to get a list of installed office converters and
their corresponding extensions. I need it to determine the file
extension when a user saves office document on a client which hides
extensions for known file types (windows explorer setting).

On these clients, the save as type combobox has items such as "Word
Document", whereas clients that show extensions have "Word Document
(*.doc)" - which in turn allows me to get the extension directly.

It seems that "Common Files\Microsoft Shared\TextConv" in the Program
Files folder contains the installed .CNV Text Converters, but it's
unclear how the get the information that I need from the files directly.

Regards,
Jim.
 
M

[MSFT]

Hello Jim,

Regaridng the question, we are finding proper resource to research on it.
We will update you as soon as possible.

Regards,

Luke
 
C

Cindy M -WordMVP-

Hi Jim,
I'm looking for a way to get a list of installed office converters and
their corresponding extensions. I need it to determine the file
extension when a user saves office document on a client which hides
extensions for known file types (windows explorer setting).
Have you taken a look in the Registry (HKLM)? Do a search on the term
"Text Converters" and look for the sub-key "Export". That should give you
a list of installed converters, their location, and the extensions they
support. Note that the listings might be spread out a bit if Office has
been upgraded through multiple versions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
J

Jim Meyer

I have, but as far as I can see, the registry does not contain the default
text converters that are available with an office installation.
 
P

Peter Huang [MSFT]

Hi

I think you may try to run the macro below to see if helps you.

Sub Test()
Dim fc As FileConverter
For Each fc In Application.FileConverters
Debug.Print fc.ClassName 'You may try to print the other properties of
FileConverter
Next
End Sub


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jim Meyer

The FileConverters collection contains the following for Word 2003 on my
development machine:

ID | CanSave | FormatName | Extensions
1 :: true - "Works 6.0 & 7.0" :: "wps"
2 :: true - "Word 97-2003 & 6.0/95 - RTF" :: "doc"
3 :: false - "Recover Text from Any File" :: "*"
4 :: false - "WordPerfect 6.x" :: "wpd doc"
5 :: false - "WordPerfect 5.x" :: "doc"
6 :: false - "Personal Address Book" :: "pab"
7 :: false - "Outlook Address Book" :: "olk"
8 :: false - "Schedule+ Contacts" :: "scd"
9 :: true - "Works 7.0" :: "wps"
10 :: false - "Windows Write" :: "wri"
11 :: false - "Word 6.0/95 for Windows & Macintosh" :: "doc"
12 :: true - "Works 6.0 & 7.0" :: "wps"

This corresponds to the last three items in the "Save As Type" combobox
in the Save As Dialog. However, all the default items such as "Word
Document", "XML Document", "Web Page" etc. are missing from the list.

Basically, what I need is a way to resolve the selected text in the Save
As Type combobox to the extensions that is corresponds to.

Of course, the full filename of the document once it has been saved will
do the trick, but I've yet to discover a reliable way to do this. The
DocumentBeforeSave event is not usefull since the extension has not yet
been set, and the user still has the opportunity to cancel the save
operation. Also, manually showing a save dialog is not an option, since
our customers may run other addins or macros which may attempt to do so.
 
C

Cindy M -WordMVP-

Hi Jim,
Basically, what I need is a way to resolve the selected text in the Save
As Type combobox to the extensions that is corresponds to.
Application.Dialogs(wdDialogFileSaveAs).Format

Returns an integer that should be linked with a specific format (rather
than a position in the list).
0 = Word doc
1 = template
2 = Text only
3 = Text only (with line breaks) - although I'm not sure this is still
valid
4 = MS-DOS text - same remark as above
5 = MS-DOS text with line breaks - same remark
6 = RTF

11 = XML Document

You might be able to complete the list...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
J

Jim Meyer

Thank you for the suggestion. However, I need a generic solution that
works with Excel, PowerPoint and Word for versions 2000, XP and 2003.

I've looked at the documentation for excel and found the following:

Dialogs "xlDialogSaveAs" has the following arguments: "document_text,
type_num, prot_pwd, backup, write_res_pwd, read_only_rec"

I think that the type_num property will give me the same result as the
Format property in Word, but I'll have to check that.

It seems that PowerPoint does not support this scenario, but I may be
wrong...

Regards,
Jim.
 
P

Peter Huang [MSFT]

Hi

For PPT, I think we can use the code below to get the list.

Sub Test()
Dim o As FileDialogFilter
For Each o In Application.FileDialog(msoFileDialogSaveAs).Filters
Debug.Print o.Extensions & o.Description
Next
End Sub

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jim Meyer

Peter said:
Hi

For PPT, I think we can use the code below to get the list.

Sub Test()
Dim o As FileDialogFilter
For Each o In Application.FileDialog(msoFileDialogSaveAs).Filters
Debug.Print o.Extensions & o.Description
Next
End Sub

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Hi,

The FileDialog property and the Filter Collections gives me just the
information that I need. Unfortunately, Office 2000 does not support
this property on the Application object. Is there any known alternative
or solution with Office 2000?

Best regards,
Jim Meyer
 
P

Peter Huang [MSFT]

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