Demonstrates how to use the PrintPreview dialog in OfficeJS.dialogs, version 1.0.8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this example takes the currently composed email message in Outlook, | |
// grabs its body HTML and then displays it in the Print Preview dialog. | |
var mailItem = Office.cast.item.toItemCompose(Office.context.mailbox.item); | |
mailItem.saveAsync(function(asyncResult) { | |
var id = asyncResult.id; | |
mailItem.body.getAsync(Office.CoercionType.Html, { asyncContext: { var3: 1, var4: 2 } }, function(result) { | |
var html = result.value; | |
PrintPreview.Show(html, function() { | |
Alert.Show("Print cancelled"); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment