Adding picture into activedocument shapes

Discussion in 'Word VBA Beginners' started by baha, Aug 14, 2011.

  1. baha

    baha Guest

    Hi Everyone,
    I have a following code for adding bmp pictures which are named from
    1 to 250, into activedocument shapes which are named from image1 to
    image250. It seems like I am doing something wrong.Any help?
    My code is
    Private Sub CommandButton1_Click()
    Dim i As Variant
    For i = 1 To 250
    ActiveDocument.Shapes("Image" & i).OLEFormat.Object.Object.Picture =
    LoadPicture(ThisDocument.Path & "\Pictures\" & i & ".BMP")
    Next i
    End Sub

    Thanks in advance
    Baha
     
    baha, Aug 14, 2011
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Fred M.

    Better name for ActiveDocument

    Fred M., Jul 22, 2003, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    164
    Doug Robbins - Word MVP
    Jul 22, 2003
  2. Ebbe
    Replies:
    6
    Views:
    315
  3. Graham Scott

    ActiveDocument.save

    Graham Scott, Feb 14, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    257
    Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT
    Feb 15, 2004
  4. Donald Nova

    Detecting ActiveDocument KeyPress

    Donald Nova, Mar 1, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    312
    Word Heretic
    Mar 2, 2004
  5. Novice
    Replies:
    2
    Views:
    1,046
    nigel
    Jul 2, 2012
  6. rich

    Mail Merge and ActiveDocument.SaveAs Question

    rich, Nov 30, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    489
    Doug Robbins
    Dec 1, 2004
  7. xgirl

    ActiveDocument.Shapes

    xgirl, Jan 17, 2005, in forum: Word VBA Beginners
    Replies:
    0
    Views:
    217
    xgirl
    Jan 17, 2005
  8. CJ

    ActiveDocument.FullName

    CJ, Feb 15, 2005, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    283
    Word Heretic
    Feb 17, 2005
Loading...