Method SetImageDecorative
SetImageDecorative(WordDocument, ImageRef, bool)
Marks a picture decorative, or not, as Word's Alt Text pane does (Phase 176, WQ-0157): a decorative picture is one a screen reader skips, so marking it removes its alternative text.
public static DocumentEdit SetImageDecorative(this WordDocument document, ImageRef image, bool decorative)
Parameters
documentWordDocumentThe document that holds the picture.
imageImageRefThe picture.
decorativeboolWhether it is decorative.
Returns
- DocumentEdit
The edit; Before is just before the picture and After just past it. The state the picture already has gives an empty edit.
Exceptions
- ArgumentNullException
documentorimageis null.- ArgumentException
The picture is not in
document, or not in a paragraph.- InvalidOperationException
The picture's drawing is not one DrawingML picture, or it is in a shape's text box.