Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created September 30, 2019 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/aa13f2abc182802de634edeefaf38e34 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/aa13f2abc182802de634edeefaf38e34 to your computer and use it in GitHub Desktop.
string outputDirectory = @"C:\output";
string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");
MemoryStream attachmentStream = new MemoryStream();
using (Viewer viewer = new Viewer("sample.msg"))
viewer.SaveAttachment("attachment-word.doc", attachmentStream);
using (Viewer viewer = new Viewer(() => attachmentStream))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
viewer.View(options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment