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
Guddi
NA
3
4.6k
Populate the cells in MS office word document table using C#
Jun 19 2013 5:49 AM
Hi,
I want to populate the table found in Function.docx.
I want to fill the cell(4,4) with "someString" ,I have written the code using interop as follows.
Application application = new Application();
Microsoft.Office.Interop.Word.Document doc = application.Documents.Open(Environment.CurrentDirectory + "\\Functions.docx", ReadOnly: false, Visible: false);
Microsoft.Office.Interop.Word.Table table = doc.Tables[1];
table.Cell(4, 4).Range.Text = "someString";
But it shows an error in a message box saying that the document Function.docx is locked by the me. Do you want to open the file as read only.
Anybody please tell me a solution. I just have lot many files like this and want to populate them all in series. I want everything to be automated.
Reply
Answers (
2
)
How to fill a word document with the data from the controls
How to create webmail using c# window application