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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help needed VC++ with MS Word

help needed VC++ with MS Word

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
4 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.
  • B Offline
    B Offline
    Barm
    wrote on last edited by
    #1

    I am in the mist of editing a legacy program which output the report to words format. I am require to add in images, but I am unable to set the position of the images. I am able to add the images but all at (0,0) range. i'm using the following codes _Document oDoc; Shapes oShape; oShape = oDoc.GetShapes(); oShape.AddPicture // v is suppose to be the indicator of the top and left points tagVARIANT v; v.lVal = v.intVal = v.iVal = v.fltVal = 200; ("C:\\Logo.JPG",vtFalse,vtTrue,&v,&v,vtOptional,vtOptional,vtOptional); the image still appear at point (0,0) Is it correct to use Shapes class or should I use InlineShapes :confused: can someone please advise me... where have I gone wrong :confused: Thomas

    J 1 Reply Last reply
    0
    • B Barm

      I am in the mist of editing a legacy program which output the report to words format. I am require to add in images, but I am unable to set the position of the images. I am able to add the images but all at (0,0) range. i'm using the following codes _Document oDoc; Shapes oShape; oShape = oDoc.GetShapes(); oShape.AddPicture // v is suppose to be the indicator of the top and left points tagVARIANT v; v.lVal = v.intVal = v.iVal = v.fltVal = 200; ("C:\\Logo.JPG",vtFalse,vtTrue,&v,&v,vtOptional,vtOptional,vtOptional); the image still appear at point (0,0) Is it correct to use Shapes class or should I use InlineShapes :confused: can someone please advise me... where have I gone wrong :confused: Thomas

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Barm wrote: tagVARIANT v; v.lVal = v.intVal = v.iVal = v.fltVal = 200; tagVariant is an union. That means all lVal, intVal, iVal, etc. share the same space, so assigning multiple fields makes no sense. You should assign only one of the value fields, and set the vt member to indicate which is the one you are using. As you didn't initialize vt, it must have remained as zero, which indicates an empty variant (i.e.: v.vt == VT_EMPTY), and that may be why the image remains at 0,0 Try the following:

      tagVariant v;
      v.vt = VT_I4;
      v.lVal = 200;

      -- jlr http://jlamas.blogspot.com/[^]

      B 2 Replies Last reply
      0
      • J Jose Lamas Rios

        Barm wrote: tagVARIANT v; v.lVal = v.intVal = v.iVal = v.fltVal = 200; tagVariant is an union. That means all lVal, intVal, iVal, etc. share the same space, so assigning multiple fields makes no sense. You should assign only one of the value fields, and set the vt member to indicate which is the one you are using. As you didn't initialize vt, it must have remained as zero, which indicates an empty variant (i.e.: v.vt == VT_EMPTY), and that may be why the image remains at 0,0 Try the following:

        tagVariant v;
        v.vt = VT_I4;
        v.lVal = 200;

        -- jlr http://jlamas.blogspot.com/[^]

        B Offline
        B Offline
        Barm
        wrote on last edited by
        #3

        thanks a lot... Thomas

        1 Reply Last reply
        0
        • J Jose Lamas Rios

          Barm wrote: tagVARIANT v; v.lVal = v.intVal = v.iVal = v.fltVal = 200; tagVariant is an union. That means all lVal, intVal, iVal, etc. share the same space, so assigning multiple fields makes no sense. You should assign only one of the value fields, and set the vt member to indicate which is the one you are using. As you didn't initialize vt, it must have remained as zero, which indicates an empty variant (i.e.: v.vt == VT_EMPTY), and that may be why the image remains at 0,0 Try the following:

          tagVariant v;
          v.vt = VT_I4;
          v.lVal = 200;

          -- jlr http://jlamas.blogspot.com/[^]

          B Offline
          B Offline
          Barm
          wrote on last edited by
          #4

          problem for position solved but I encounter another problem, i need to put the images into different cells in a table and some images are to be outside the table. The codes is able to work but all the images are inserted into the first cell in the first table. Is there a way to set the position with respect to the a cell? Thomas

          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