I attached the doc file by the thread, please check it like this:
- Code: Select all
Dim cachfile As FileInfo = New FileInfo(strUploadPath + printtemp + getname + ".doc")
Dim document As Document = New Document(strUploadPath + printtemp + getname + ".doc")
document.SaveToFile("打开她并保存为另一个名字的文件.Docx", FileFormat.Docx)
Just open the doc with document object, and then save it.
you will get this error:
- Code: Select all
System.ArgumentException: '', hexadecimal value 0x01, is an invalid character.
at System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)
at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
at System.Xml.XmlWellFormedWriter.WriteString(String text)
at spr673.10()
at spr673.0(Stream A_0, Document A_1)
at spr673.0(String A_0, Document A_1)
at Spire.Doc.Document.4(String A_0)
at Spire.Doc.Document.SaveToFile(String fileName, FileFormat fileFormat)
No luck.
It's a big problem, the problem doc is create in word2007 in normal way.
yours,
Ivan