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
chetan Allipur
NA
541
167.7k
How to remove the Instruction Text in word using VSTO.
Jun 21 2017 3:34 AM
How to remove the Instruction Text in word using VSTO.
Here is my code.
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Word.Document doc1 = app.ActiveDocument;
Selection wordSelection = Globals.ThisAddIn.Application.Selection;
Microsoft.Office.Interop.Word.Style style = wordSelection.Paragraphs.get_Style();
wordSelection.HomeKey(WdUnits.wdStory);
doc1.Content.Find.ClearFormatting();
doc1.Content.Find.Replacement.ClearFormatting();
doc1.Content.Find.set_Style(doc1.Styles["Instructions"]);
//style= doc1.Styles["Instructions"];
doc1.Content.Find.Text = "";
doc1.Content.Find.Replacement.Text = "";
doc1.Content.Find.Forward = true;
bInstructions = doc1.Content.Find.Execute(WdReplace.wdReplaceAll);
Reply
Answers (
2
)
Complete code for a Form with 2 text boxes
How to Remove the Instructions Text in word in VSTO