TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rajarajan
NA
14
11.9k
adding content Word application not working in vb.net
Jun 25 2015 10:23 AM
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
Reply
Answers (
0
)
ComboBox strategies to function
Get week number from datetime picker