5 Replies Latest reply: Mar 23, 2016 3:03 PM by John Watson RSS

    CopyBitmapToClipboard

    Albert Tapia Casellas

      Hi!

      I have a problem when I try to copy an object into a Word (as Image) mutiple times.

      This is a sample of the script that I've done:

       

      Sub Report


      Set XWord = CreateObject("Word.Application")
      XWord.Visible=true

      Set DocWord = XWord.Documents.add()

      Set F= ActiveDocument.Fields("User")
      Set FieldValue= F.GetSelectedValues(F.GetValueCount(1))

       

      For k=0 to F.Count-1


      ActiveDocument.Fields("User").Select FieldValue.Item(k).Text

      XWord.Selection.InsertBefore "Titulo"&chr(13)
      XWord.Selection.Collapse wdCollapseEnd

      ActiveDocument.ClearCache
      ActiveDocument.GetApplication.WaitForIdle

      set image = ActiveDocument.GetSheetObject("CH684")
      image.CopyBitmapToClipboard
      XWord.Selection.Paste

      next

      end sub

       

      The Script stops when it reaches "image.CopyBitmapToClipboard".Does somebody know if there is a issue with this function?

      Version: 9.00.7320.7 SR2 64-bit Edition

       

      Thanks!