hi...i wrote the following function...
Code:(text)
1.Private Function Convert2word(txtSourceFile As String) As String
2.Dim fso As FileSystemObject
3.fso.CopyFile txtSourceFile, "D:\filename.doc"
4.Convert2word = "D:\filename.doc"
5.End Function
But its hitting an error saying...Runtime error '91' Object variable or with block variable not set....at the line 3 in the above code....what does it mean and can anyone help me out plz???...
just change the extenstion,it'll become a word document..
make sure to add Microsoft Scripting Runtime to ur project references,then add the following code..
- dim fso as filesystemobject
-
-
private sub form_load()
-
fso.copyfile("filepath\filename.txt","filepath\filename.doc")
-
msgbox "saved successfully."
-
end sub