以下是我的代码:
Private wordApp As Word.Application
Private Sub Command1_Click()Dim wordDoc As Word.Document
Set wordApp = Word.Application
Set wordDoc = wordApp.Documents.Open(C:\Documents and Settings\acer\My Documents\景德镇.doc) '打开word文件
wordDoc.SaveAs "C:\Documents and Settings\acer\My Documents\景德镇.rtf" '另存为rtf格式文件
wordApp.Quit
Set wordDoc = Nothing
Set wordApp = Nothing
End Sub
问题:1、这段程序只能运行一次。再运行Set wordApp = Word.Applicatio出错
2、能否有其他方式转换制定文件的格式,doc到rtf
3、转换的格式在后台进行。
谢谢各位大侠帮忙!!!!!!!!!
Private wordApp As Word.Application
Private Sub Command1_Click()Dim wordDoc As Word.Document
Set wordApp = Word.Application
Set wordDoc = wordApp.Documents.Open(C:\Documents and Settings\acer\My Documents\景德镇.doc) '打开word文件
wordDoc.SaveAs "C:\Documents and Settings\acer\My Documents\景德镇.rtf" '另存为rtf格式文件
wordApp.Quit
Set wordDoc = Nothing
Set wordApp = Nothing
End Sub
问题:1、这段程序只能运行一次。再运行Set wordApp = Word.Applicatio出错
2、能否有其他方式转换制定文件的格式,doc到rtf
3、转换的格式在后台进行。
谢谢各位大侠帮忙!!!!!!!!!
automation error
the message filer indicated that the appication is busy.是不是与杀毒软件有关。
If Err.Number <> 0 Then '如果 Word 没有运行则
Set Wrd = CreateObject("Word.Application") '运行它
End If
Err.Clear '清除发生错误的 Err 对象
On Error GoTo 0 '保留普通错误进程
Dim dot As String
Dim doc As String
dot = "c:\temp.dot"
doc = "c:\temp.doc" Documents.Open FileName:=dot, _
ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
0
Wrd.Visible = False
Wrd.ActiveDocument.Close
Wrd.Documents.Add Template:=dot, NewTemplate:=False
to:lxcc(虫莲) 格式转换呢。
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False