Click here to Skip to main content
15,905,682 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,


I am automating Word styling using
C#
Microsoft.Office.Interop.Word;


I am in urgently in need of help.

for example.

If the paragraph is like below(with out any number-plain text) need to set one style

When the following terms are used in the mandatory standards and recommended practices for marine safety investigations they have the following meaning.

If the paragraph is like below another style

2.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

If the paragraph is like below another style

2.1.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

If the paragraph is like below another style

2.1.1.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

could you please help how to do this.

Thanks
Posted
Comments
TheCoolCoder 5-Nov-12 0:04am    
using COM Interop in a server environment is not supported by Microsoft. Also there are licensing issues related to using Office.Interop in a client-server environment. Refer this discussion.

The KB article Considerations for server-side Automation of Office does indeed say that you are licensed for server-side automation of Office products for use only if the clients are all licensed.

Just in case you are not aware of these.

If you want reliable/approved behaviour for your code Open XML SDK for Microsoft Office is the way to go with asp.net though only Office 2007 and later document formats are supported.
Sergey Alexandrovich Kryukov 5-Nov-12 0:12am    
I never understood why you and other Web developers try to use proprietary Office on the Web generally using open standards. To me, it looks like the psychology of a non-developer desktop users why try to move this experience into programming...
--SA
TheCoolCoder 5-Nov-12 0:19am    
@SA : I dont completely understand your comment, what i pointed out was wrong? or is something else?? or is it directed at OP?
Sergey Alexandrovich Kryukov 5-Nov-12 0:41am    
No, I basically agree with you; this is my comment of the question. I don't think Office programming is a good thing, trying to explain why it happens...
--SA
TheCoolCoder 5-Nov-12 0:46am    
I thought so as you added a comment to the question and not reply, but wasnt sure if you disagreed with the whole idea..:-)..thanks..

1 solution

 
Share this answer
 
v2
Comments
Lancy.net 4-Nov-12 23:26pm    
Thanks a lot Abhinav i will chk and update..

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