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?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred M.

    Better name for ActiveDocument

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

    ActiveDocument.save

    Graham Scott, Feb 14, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    233
    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:
    291
    Word Heretic
    Mar 2, 2004
  5. Novice
    Replies:
    2
    Views:
    929
    nigel
    Jul 2, 2012
  6. rich

    Mail Merge and ActiveDocument.SaveAs Question

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

    ActiveDocument.Shapes

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

    ActiveDocument.FullName

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