Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Accessing Object property of OLEFormat

Accessing Object property of OLEFormat

Scheduled Pinned Locked Moved Visual Basic
comdata-structureshelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smritiy
    wrote on last edited by
    #1

    I'm trying to save the OLE objects in a MSWord document in separate files. So I want to iterate through each shape , access its OLE object, convert it into an image and save the image to a file. However when I try to access the shape.OLEFormat.object it gives me a run-time error saying "No such interface supported". Here's a snippet of the code: dim myrange as range dim oShape as word.shape dim chart as graph.chart myrange = doc.paragraphs(1).range for i = 1 to myrange.shaperange.count oShape = myrange.shaperange(i) select case oShape.type case msoShapeType.msoEmbeddedOLEObject chart = Ctype(oShape.OLEFormat.object,graph.chart) case else ... end select next Can anybody tell me where I'm going wrong ?? Smriti

    D 1 Reply Last reply
    0
    • S smritiy

      I'm trying to save the OLE objects in a MSWord document in separate files. So I want to iterate through each shape , access its OLE object, convert it into an image and save the image to a file. However when I try to access the shape.OLEFormat.object it gives me a run-time error saying "No such interface supported". Here's a snippet of the code: dim myrange as range dim oShape as word.shape dim chart as graph.chart myrange = doc.paragraphs(1).range for i = 1 to myrange.shaperange.count oShape = myrange.shaperange(i) select case oShape.type case msoShapeType.msoEmbeddedOLEObject chart = Ctype(oShape.OLEFormat.object,graph.chart) case else ... end select next Can anybody tell me where I'm going wrong ?? Smriti

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Yeah, the OLEFormat.object is not convertable to a Graph.Chart object. You must use the methods on the OLEFormat object to manipulate it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Yeah, the OLEFormat.object is not convertable to a Graph.Chart object. You must use the methods on the OLEFormat object to manipulate it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        S Offline
        S Offline
        smritiy
        wrote on last edited by
        #3

        Actually all I had to do was invoke OLEFormat.edit() and then access the object property to cast it into a chart object. shape.OLEFormat.edit() Graph.chart chart = shape.OLEFormat.object And this works. Thanks anyway.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups