none
VBA - Send image to back RRS feed

  • Question

  • I am trying to place an image in word and send it to the back. The placement work fine but cannot get it to send to back.

    [code]

        

    Sub InsertImage2()

        Dim imagePath As String, image As Shape
        imagePath = "T:\install\gif\Flesh_100_Year_Logo\parsonsi100yearsinvoice_lg.jpg"

        Set image = ActiveDocument.Shapes.AddPicture(FileName:=imagePath, _
        LinkToFile:=False, _
        SaveWithDocument:=True, _
        Left:=-36, _
        Top:=-72, _
        Anchor:=Selection.Range, _
        Width:=612, _
        Height:=792)

        ActiveDocument.Shapes("image").Select
        Selection.ShapeRange.ZOrder msoSendToBack

    End Sub

    [\code]

    any assistance would be greatly appreciated.

    Steve

    Friday, June 21, 2013 5:15 PM

Answers

  • Instead of "image.ZOrder msoSendToBack" I used "image.ZOrder msoSendBehindText" and it worked - You pointed me in the right direction.

    Thank you

    Steve

    • Marked as answer by skirkpatrick Monday, June 24, 2013 3:59 PM
    Monday, June 24, 2013 3:59 PM

All replies

  • Replace Below:

     ActiveDocument.Shapes("image").Select
        Selection.ShapeRange.ZOrder msoSendToBack

    with:

    image.ZOrder msoSendToBack


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Saturday, June 22, 2013 10:22 AM
    Answerer
  • Instead of "image.ZOrder msoSendToBack" I used "image.ZOrder msoSendBehindText" and it worked - You pointed me in the right direction.

    Thank you

    Steve

    • Marked as answer by skirkpatrick Monday, June 24, 2013 3:59 PM
    Monday, June 24, 2013 3:59 PM