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
Mamta Jain
NA
417
14.4k
how to remove header from word file by using DocumentFormat
Dec 11 2016 11:42 PM
How to remove header part from Selected word file using Document.Format
I am using .Net Framework 2.0
My Code :
public void removeheader()
{
string temp_path = txtUpload.Text;
using (DocumentFormat.OpenXml.Packaging.WordprocessingDocument doc = WordprocessingDocument.Open(temp_path, true))
{
var docPart = doc.MainDocumentPart;
// if (docPart.HeaderParts.Count() > 0 )
{
docPart.DeleteParts(docPart.HeaderParts);
Document document = docPart.Document;
var headers = document.Descendants
().ToList();
foreach (var header in headers)
{
header.Remove();
}
document.Save();
}
}
}.
Here
DocumentFormat
.OpenXml.Packaging.WordprocessingDocument doc = WordprocessingDocument.Open(temp_path, true)
getting Error , how I include related Framework SDK file to remove error ? or any other Suggestion
Reply
Answers (
5
)
how to create custom action install shield
when i clicking a button inside jquery popup.its close