none
Adding a picture to all pages at specific position using c# RRS feed

  • Question

  • Hi,

    I need to add a picture at specific position(not in the header or footer) to all pages in a word (and powerpoint) document.

    Is there a way to do it without causing the pages to scroll or the cursor to jump?

    Thanks.


    Wednesday, September 9, 2015 5:18 PM

Answers

  • Hi shenhavba,

    You may use Shapes.AddCanvas method to add canvas to a document, it will returns a shape object, then you could use Shape.CanvasItems.AddPicture method to add picture.

    For this way, the position is based on current page, so you need to navigate to next page and the scroll will jump, I tried set ScreenUpdating property to false, but it still jumps too. I don't find a way to prevent to page to jump.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by shenhavba Friday, September 11, 2015 4:25 AM
    Thursday, September 10, 2015 9:46 AM
    Moderator
  • I need to add a picture at specific position(not in the header or footer) to all pages in a word (and powerpoint) document.

    What is the objection to using Word's page header or footer? Unnecessarily adding a picture to every page could greatly increase the document's file size. You also risk having the picture changing position (even pages) if the document is opened on a PC using a different printer (or even the same printer with a different OS) or, of course, if the page layout gets changed.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by shenhavba Friday, September 11, 2015 4:25 AM
    Thursday, September 10, 2015 10:08 AM

All replies

  • Mmm, not really, as the only way to address "pages" in Word is by using the Selection object. You could try setting Application.ScreenUpdating = False

    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, September 9, 2015 6:29 PM
    Moderator
  • Hi shenhavba,

    You may use Shapes.AddCanvas method to add canvas to a document, it will returns a shape object, then you could use Shape.CanvasItems.AddPicture method to add picture.

    For this way, the position is based on current page, so you need to navigate to next page and the scroll will jump, I tried set ScreenUpdating property to false, but it still jumps too. I don't find a way to prevent to page to jump.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by shenhavba Friday, September 11, 2015 4:25 AM
    Thursday, September 10, 2015 9:46 AM
    Moderator
  • I need to add a picture at specific position(not in the header or footer) to all pages in a word (and powerpoint) document.

    What is the objection to using Word's page header or footer? Unnecessarily adding a picture to every page could greatly increase the document's file size. You also risk having the picture changing position (even pages) if the document is opened on a PC using a different printer (or even the same printer with a different OS) or, of course, if the page layout gets changed.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by shenhavba Friday, September 11, 2015 4:25 AM
    Thursday, September 10, 2015 10:08 AM