none
Creating a word doc using c# ? RRS feed

  • Question

  • Hi,

       I would like to know how to add an image to MS Word.,using MS-interop Library.

    Thanks in Advance.

    Friday, July 13, 2012 5:54 AM

Answers

  • Hi learning

    Please remember to always mention the version of Word involved in a problem. Versions are different (that's why there are versions), and an optimal answer can depend on knowing which version.

    Document.Shapes.AddPicture

      or

    Document.InlineShapes.AddPicture

    which to use depends on how the graphics object should behave in the document. An InlineShape is handled like a text character. A Shape can have text flow formatting and be placed freely on the page.


    Cindy Meister, VSTO/Word MVP

    Friday, July 13, 2012 6:21 AM
    Moderator
  • Attaching a document on to a logo. That's an interesting way of looking at it ;)

    This example shows how to use interop to start Word and open a document. Then you can use the commands Cindy demonstrates to add an image. If you want to attach to a document that is already open, Google something like "attach to open Word document C#". There are lots of examples.

    Friday, July 13, 2012 12:40 PM

All replies

  • Hi learning

    Please remember to always mention the version of Word involved in a problem. Versions are different (that's why there are versions), and an optimal answer can depend on knowing which version.

    Document.Shapes.AddPicture

      or

    Document.InlineShapes.AddPicture

    which to use depends on how the graphics object should behave in the document. An InlineShape is handled like a text character. A Shape can have text flow formatting and be placed freely on the page.


    Cindy Meister, VSTO/Word MVP

    Friday, July 13, 2012 6:21 AM
    Moderator
  •  Hi Cindy,

            I want a Logo to be added on to the MS Word2010,

          when i attach a document .,on to it.

    Friday, July 13, 2012 12:35 PM
  • Attaching a document on to a logo. That's an interesting way of looking at it ;)

    This example shows how to use interop to start Word and open a document. Then you can use the commands Cindy demonstrates to add an image. If you want to attach to a document that is already open, Google something like "attach to open Word document C#". There are lots of examples.

    Friday, July 13, 2012 12:40 PM