J
jtanaka
I have a macro I use to save a binary Word document as WordML (XML). When I
perform the save, I want to remove all the special character formatting that
Word may have. For example, Word's Autoformatter changes hyphens to dashes
and apostrophes to curly apostrophes. I would like my saved XML to be clean
of these Word specific encodings. Is there a way to do this?
I tried adding the 'Encoding' and the 'AllowSubstitutions' parameters, but
this did not help.
It is not an option for me to have the authors of the documents I'm working
with disable the AutoFormatting options.
Sub SaveAsXML()
ChangeFileOpenDirectory _
"C:\Temp\"
Dim xmlfilename As String
xmlfilename = ActiveDocument.Name
'replace the extension with xml
xmlfilename = Left$(xmlfilename, Len(xmlfilename) - 3) & "xml"
ActiveDocument.SaveAs _
FileName:=xmlfilename, _
FileFormat:=wdFormatXML, _
Encoding:=msoEncodingUTF8, _
AllowSubstitutions:=True
End Sub
Thanks in advance,
Julie
perform the save, I want to remove all the special character formatting that
Word may have. For example, Word's Autoformatter changes hyphens to dashes
and apostrophes to curly apostrophes. I would like my saved XML to be clean
of these Word specific encodings. Is there a way to do this?
I tried adding the 'Encoding' and the 'AllowSubstitutions' parameters, but
this did not help.
It is not an option for me to have the authors of the documents I'm working
with disable the AutoFormatting options.
Sub SaveAsXML()
ChangeFileOpenDirectory _
"C:\Temp\"
Dim xmlfilename As String
xmlfilename = ActiveDocument.Name
'replace the extension with xml
xmlfilename = Left$(xmlfilename, Len(xmlfilename) - 3) & "xml"
ActiveDocument.SaveAs _
FileName:=xmlfilename, _
FileFormat:=wdFormatXML, _
Encoding:=msoEncodingUTF8, _
AllowSubstitutions:=True
End Sub
Thanks in advance,
Julie