Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
adding content Word application not working in vb.net
Rajarajan
Jun 25 2015 10:23 AM
497
Reply
I am using below code in asp.net vb.net to create an object for word document to write in it. But receiving the below error. please help me in fixing this. I already used this code in another machine it worked perfectly. But i used this code in new machine where software newly installed. it is not working in the new machine.
Error:
Object variable or With block variable not set
This command is not available because no document is open
Code:
Dim fso As Object
Dim doc As Object
Dim objWord As Object
Dim WordDocument As Object
fso = CreateObject("Scripting.FileSystemObject")
objWord = CreateObject("word.application")
WordDocument = objWord.documents
doc = WordDocument.open(DestFileName)
With objWord.Selection.Find
.
.
.
End With
objWord.ActiveDocument.Save()
objWord.ActiveDocument.Close()
objWord.Quit()
fso = Nothing
doc = Nothing
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
ComboBox strategies to function
reading data from sql server in vb.net