
4,397 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear community,
I noticed that MS Word has a different anchoring when we add an image to a page footer using Interop.
The anchoring position depends on the HeaderFooterIndex (See below results)
Example: Insert shape to header
Section section = ...;
section.Headers[VarHeaderFooterIndex].Shapes.AddPicture(FileName: fileName, Left: 0, Top: 0);
// The result depending on 'VarHeaderFooterIndex' value is:
// wdHeaderFooterPrimary -> Shape will be anchored to header (ok)
// wdHeaderFooterFirstPage -> Shape will be anchored to header (ok)
// wdHeaderFooterEvenPages -> Shape will be anchored to header (ok)
Example: Insert shape to footer
Section section = ...;
section.Footers[VarHeaderFooterIndex].Shapes.AddPicture(FileName: fileName, Left: 0, Top: 0);
// The result depending on 'VarHeaderFooterIndex' value is:
// wdHeaderFooterPrimary -> Shape will be anchored to footer(ok)
// wdHeaderFooterFirstPage -> Shape will be anchored to header (not ok)
// wdHeaderFooterEvenPages -> Shape will be anchored to header (not ok)