1

I am new to sharepoint 2010 and i have Sharepoint 2010 Foundation installed on server. To open word document in browser i had installed Microsoft Office Web Apps on the server and configured it and set the default open behavior to it as well. Now the requirement is i want to progmatically create new word document and want to add some predefined content in it using the code and after that i need to store that document in the library and then after open that document in word web app viewer as well. And also want this same process for the excel file as well.

Please tell me what i need to do to achieve this requirement.

Thanx in advance, your response is appreciated.

1 Answer 1

2

You'll need to use the Open XML SDK 2.0 from Microsoft to programatically create your Word document. Follow this link for more information: http://msdn.microsoft.com/en-us/library/office/bb448854.aspx

You'll need to let us know how you want to initiate the creation of the Word document so we can recommend where to start from a Sharepoint point of view.

2
  • I read about the Office XML it will be helpful for me as well. but as u said that from where i want to initiate the creation. So I want to create one new document using it and add content within it and then after i want to store that document in sharepoint document library. I want to do this using my asp.net application. So what should i do for this and plz suggest me a code snippets if possible to achieve this. @Ian Aug 14, 2012 at 10:49
  • I created document using office XML but now i m going to store that document in sharepoint library then it giving me an error like ["The Web application at {siteUrl} could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application."]...Note that my asp.net application running on the same server where sharepoint running. I have added Microsoft.sharepoint to my application but when i going to create the object of SPSite then it giving me this error. Aug 16, 2012 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.