Load document using the local path string
Leave feedback
You can load a document from a local disk using a path to a file. GroupDocs.Viewer opens the file in the read-only mode.
The following code snippet shows how to load a document using the local path string:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...// Specify a path to a file.stringfilePath="sample.docx";// Render the file.using(Viewerviewer=newViewer(filePath)){HtmlViewOptionsviewOptions=HtmlViewOptions.ForEmbeddedResources();viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())' Specify a path to a file.
DimfilePathAsString="sample.docx"' Render the file.
UsingviewerAsViewer=NewViewer(filePath)DimviewOptionsAsHtmlViewOptions=HtmlViewOptions.ForEmbeddedResources()viewer.View(viewOptions)EndUsingEndSubEndModule
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.