none
I'm adding image to document, but how i set its location? RRS feed

  • Question

  • string image = @imagePath;
    doc.InlineShapes.AddPicture(image);

    Following code, will the image from path and add it at top left of the document's first page, I want to be able to edit this so that I can set where the image will be showing, how? 

    Tuesday, June 18, 2019 8:30 AM

All replies

  • The takes AddPicture method takes four parameters:

    InlineShapes.AddPicture (FileName, LinkToFile, SaveWithDocument, Range)

    In addition to the FileName, your code needs to specify the Range. LinkToFile and SaveWithDocument both default to False (SaveWithDocument is only applicable when LinkToFile is True).


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, June 18, 2019 8:53 AM