在孔兄的提示下,改写了,能PASS,但总觉2、3、4部分可合并。 If Right(aDoc.Name, 4) = ".doc" Then '为避免将源DOC文档覆盖,此类文件单独处理,在其主名后加"_Z.DOC" aDoc.SaveAs aDoc.Path & "\" & Mid(aDoc.Name, 1, Len(aDoc.Name) - 4) & "_Z.DOC", FileFormat:=wdFormatDocument ElseIf Right(aDoc.Name, 4) = ".fbd" Then aDoc.SaveAs aDoc.Path & "\" & Mid(aDoc.Name, 1, Len(aDoc.Name) - 4) & ".DOC", FileFormat:=wdFormatDocument ElseIf Right(aDoc.Name, 4) = ".txt" Then aDoc.SaveAs aDoc.Path & "\" & Mid(aDoc.Name, 1, Len(aDoc.Name) - 4) & ".DOC", FileFormat:=wdFormatDocument ElseIf Right(aDoc.Name, 4) = ".rtf" Then aDoc.SaveAs aDoc.Path & "\" & Mid(aDoc.Name, 1, Len(aDoc.Name) - 4) & ".DOC", FileFormat:=wdFormatDocument Else aDoc.SaveAs aDoc.Path & "\" & aDoc.Name & ".DOC", FileFormat:=wdFormatDocument End If |