Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to replace some words in doc document using asp.net(C#),the style could not be changed,the words are in tables,
who could help me?
if you could provid attachment,it will make me work more easily
Posted

1 solution

Words in table as in html table in word, right? (not DB table!)

One of the ways:
Using Javascript & Work Macro

Since it's a Web application in consideration, what you are asking requires knowledge not only of Javascript but of the Microsoft Word Macro Language and ActiveX automation through which you can access the word application.

To learn more about the latter you need to learn about the Javascript "ActiveXObject" and "GetObject" and you need to look through the Microsoft Word help files for information on the Microsoft Word Object Model and automation. Full information on word's Macro language can be found in its help files.

To give you a starter, when your Word Document is open, you can get a handle on the Word automation object using:-

var oWord=GetObject("","Word.Application");
var oActiveDocument=oWord.ActiveDocument;

The rest of it you can find in MS Word's help files if you look for it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900