Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)

I want to delete shapes and replace the content on the shape at the same postion as it is. For example - in a doc file , i have a textbox with some content. I just want to remove the textbox and want to put/insert content of textbox on the same position where the textbox was.

ope u understood my question. Please guide me for the same.

I am successful in reading the text from each textboxs, insert value in word document at zero position(ie - Word.Range rng = document.Range(ref start1, ref end1); where start1 = 0 and end1 = 0), determine if the shape is a textbox or not and delete the textbox. The main thing i am searching for is, determining the position(Coordinate/start,end value) of each textbox so that is can delete the textbox and insert the text inside that textbox on a position where the textbox was.I need the code in C# and i am using microsoft word 2010.

Please let me know if you need code snippet.
any new approach is most welcome.
Thanks in advance.
Updated 29-Jun-15 3:18am

1 solution

Why don't you use Content controls which are available in Word.
Have a look at the below link.[^]
Share this answer
Vandana87 30-Jun-15 3:42am    
Hi praveen,
i jst saw the aove link. Thankyou for the same, but i looking for a c# code as i want make an application that does the above work. i have many document where this need to be done dynamically. I am new to this so please guide me for the same.

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