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

Opening Word Doc

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.


var
 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);

1 Reply

DB Dilli Babu Nandha Gopal Syncfusion Team 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. 
 
Regards, 
Dilli babu. 


Loader.
Up arrow icon