Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more: , +
Hello All,

I have made an application which does some excel programming in c#.

Basically it reads data from col1 and col2 and then generates chart from that.
Now I have 100+ charts so what I want to do is copy all those charts from excel worksheet and paste them all in new Microsoft Word document or another option could be copy and paste all charts in excel first then convert excel file to Microsoft Word file.

I have tried all possibilities but I couldn't find anything called copy/paste for Microsoft word.

Thanks and cheers,
Mohit.
Posted
Updated 16-Mar-11 10:46am
v3

It sounds as if you need Microsoft Office Interop[^].

This will enable you to perform practically any Office operation.
 
Share this answer
 
Comments
mohit`12 16-Mar-11 15:46pm    
thanks alot that solved my problem in seconds.. :D thanks again

Cheers
mohit`12 16-Mar-11 16:05pm    
i was also wondering if you know how can you change name of your document when i tried sheet.name="BB" it says document is readonly cannot change name. :/
Henry Minute 16-Mar-11 16:10pm    
I am not 100% sure as I have never had to do that, but if it was me I would try 'Save As'. Of course you would then need to delete the original, if the above works but I'm sure that if you dig around you might find a way to do it in Interop. If not use the plain old C# File.Delete() method.

If none of that works, then I can only suggest you ask a fresh question.

Good luck! :)
Espen Harlinn 16-Mar-11 19:12pm    
5ed!
Albin Abel 17-Mar-11 5:33am    
My 5
In answer to the other question about sheet names...
see here[^].
 
Share this answer
 
Comments
Espen Harlinn 16-Mar-11 19:12pm    
Right - 5ed!
Albin Abel 17-Mar-11 5:34am    
Right link
mohit`12 17-Mar-11 9:12am    
thanks but i was looking for Microsoft.Office.Interop.Word; i know how to add sheet name in excel.
if you know how to exact same thing for Microsoft word let me know thanks

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