need to create new file type - Word 2000

J

Jesse

Using Word 2000, is there a way to create a new file "type"?

I use word to create files that are saved with the .xml extension.
The files need to simply be in the txt format (I create the
non-standard xml headers that I need), but with the xml extension.

When I name a file test123.xml, Word appends .doc to it. The only
workaround I've found is to first change the file type to .txt (text
only) and then save test123.xml. Is there any place within Word or
the registry (XP) where I can create an xml file type with txt
format? I would like to be able to just enter test123.xml in the Save
dialog and then click Save - without the other extra clicks. Thanks.
Jesse
 
S

Stefan Blom

In the Save As dialog box, enclose the file name and extension in quotation
marks. For example: "my document.xyz"

When you click the Save button, Word uses the file type you chose and
applies the extension you typed.

--
Stefan Blom
Microsoft Word MVP


in message news:[email protected]...
 
P

Peter Jamieson

In theory, you could probably either use the registry to create a new
extension for an existing external file converter that can convert to text
format (but there is no standard external converter that does that, as the
text converter is internal), or create a new text converter, which requires
you to use the Text Converter SDK to create a suitable .DLL, which would
almost certainly be overkill for this problem.

But in any case, when you select a specific "Files of Type", you are
telling Word to save in that format. So even if you created a text converter
that recognised type .xml, you would have to select that type in Files of
Type - just using the extension in the filename box isn't enough - e.g. even
if you type "myfile.xml" with the Files of Type set to .doc, you will get a
file named myfile.xml rather than myfile.xml.doc, but it will still be in
..doc format despite the name.

One approach if you are creating many of these files at the same time would
be to use Tools|Options|Save to set the save format temporarily to .txt, and
verify that the Files Of Type is set to .txt when you save, In this case,
when you specify myfile.xml as the name, Word does not appear to add .txt to
the end.

Otherwise, how about creating a simple macro such as

Sub SaveAsDotXML1()
Dim strPathName = InputBox("Full path name", "My Save As Dot XML")
If strPathName <> "" Then
ActiveDocument.SaveAs strPathName, wdFormatText
End If
End Sub

or perhaps

Sub SaveAsDotXML2()
Dim dlgFSA As Word.Dialog
Set dlgFSA = Word.Dialogs(wdDialogFileSaveAs)
dlgFSA.Format = wdFormatText
dlgFSA.Show
Set dlgFSA = Nothing
End Sub

Assign the sub to a toolbar button or keystroke, and use it as required.
 
J

Jesse

Thanks. BTW, that worked as far as it went -- i.e., it does not add
..doc -- but using "file.xml" (w/ quotes) saves the file in (what seems
to be) Word formatting. Maybe Peter Jamieson's code will work for me.
-- Jesse
 
S

Stefan Blom

Well, as I wrote, the type of document is determined by the conversion
filter. My suggestion only changes the file extension. However, it should do
what you were asking (or at least what I *thought* you were asking): save
text documents with a different file name extension.

--
Stefan Blom
Microsoft Word MVP


in message
 

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