Is it Possible to create a new document with the contents selected (ex:paragraph,image) in the current open docuemnt using open xml sdk?
Thanks in Advance
There is no selection in the WordprocessingML document format, so you cannot set any kind of selection using the Open XML SDK. In your other recent post, you mention creating a Word add-in. If you are doing that and referring to the current open document in Word, then you can use the Word Object Model. It offers many more options than the Open XML SDK since you have access to all the functionality of Word rather than just the document format.
It should be possible to create a new document with the selected text in the Word UI. The WordOpenXML property should return a string that contains the selection as a Word Open XML document in the flat file format. You should be able to stream this to a new file with the extension *.xml. It shouldn't need any additional processing. When opened in Word it should appear as a correct document.
Thanks cindy.I have achieved this by extracting XML of the current selelction and created a new document using that xml.