We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Opening Word Doc

Thread ID:





140859 Nov 11,2018 09:37 PM UTC Nov 12,2018 11:00 AM UTC Xamarin.iOS 1
Tags: DocIO
Mason Merrell
Asked On November 11, 2018 09:37 PM UTC

Hello I keep getting this error when trying to open a word doc as follows. Any help on what I'm doing wrong here would be appreciated.

 fileName = "Wyoming_50_Sample.docx";
            var entry = placehold1;
            WordDocument document = new WordDocument(fileName);
 'WordDocument' does not contain a constructor that takes 1 arguments

           document.Replace("<<Placeholder_1>>", entry.Text, false, true);

Dilli Babu Nandha Gopal [Syncfusion]
Replied On November 12, 2018 11:00 AM UTC

Hi Mason, 
Thank you for contacting Syncfusion support. 
It is not possible to open/save the Word document in a file system using their path in our portable platforms (ASP.NET Core and Xamarin) since file accessing various across different targets (Operating System/ platform). So, we have provided WordDocument constructors only with stream overloads. 
To load/open a Word document, the document must be an embedded resource in your application. By using Xamarin.Forms DependencyService, the memory stream can be saved a storage file with respective to their platforms (Windows, Android, iOS). Please find our UG documentation for saving a PDF document as storage file in all Xamarin.Forms platforms below. 
The code example to perform open and save of a Word document in Xamarin platform is available in following link. 
You can also look at our Sample browser samples in following GitHub location 
Please let us know if you have any questions. 
Dilli babu. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon