none
How to insert a background picture into a Word 2010 document using c# (Visual Studio 2010) RRS feed

  • Question

  • How to insert a background picture into a Word 2010 document using c# (Visual Studio 2010)

    A picture visible on every page of the document and sometimes only on one specific page. I need to know how to implement these 2 scenarios.

    The picture should always remain in the same position on a page. Most of the time the background image need to be centered on the page (not in the header or the footer).

    Thank You

    Michel Cunha


    MCunha

    Thursday, February 6, 2014 3:59 PM

Answers

All replies

  • The best way to get a handle on this is to figure out how to do it as a user. And then record doing it in a macro to find out what the object, properties and methods are. That will be VBA code, but converting it to C# is no big deal, once you know the required object, properties and methods. You might also refer to existing discussions, for example

    http://social.msdn.microsoft.com/Forums/office/en-US/bf44cce4-422a-45a0-a522-737d991e3368/word-2010-add-a-background-picture-into-a-document?forum=worddev

    The problem with just giving you code is that graphics management is exceedingly complex. It's unlikely we'd hit on the "right" answer, so there'd be a lot of back-and-forth - frustrating for us and for you. Having a solid starting point (the basic code) makes a huge difference.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, February 6, 2014 4:19 PM
    Moderator
  • Hi Cindy,

    Thank You for your quick answer.  

    Usually I learn quickly from sample codes; however I will try your suggestion :)


    MCunha

    Thursday, February 6, 2014 5:32 PM
  • Hi,

    Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please free feel to reopen it or submit a new question.

    Thanks for your understanding.

    Best regards

    Fei


    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.

    Friday, February 14, 2014 1:53 AM
    Moderator