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. Office Automation

Office Automation

Scheduled Pinned Locked Moved C / C++ / MFC
questiontestingtoolshelptutorial
4 Posts 3 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.
  • R Offline
    R Offline
    Richard Ellis
    wrote on last edited by
    #1

    I am have just started to teach myself about how to automate Office etc. I have found some knowledge base articles and am working my way throught them. Presently I am looking at Q179706 which talks about automatind Excel. About 30 or so rows into the sample code in the article is the following code snippet //Format A1:D1 as bold, vertical alignment = centre range = sheet.GetRange(COleVariant("A1"), COleVariant("D1")); font = range.GetFont(); font.SetBold(covTrue); range.SetVerticalAlignment(COleVariant((short) -4108)); //xlVAlignCentre = -4108 range is of type Range and sheet of type _Worksheet My question is this, how am I supposed to know xlVAlignCentre = -4108? I have searched files on my pc and MSDN for a definition or reference to where it is declared but turned up zip. I have found references to xlvAlignBottom etc on MSDN but nothing to tell me where they are stored or what their value is. Can anybody help? Thanks in advance Richard Ellis

    C M R 3 Replies Last reply
    0
    • R Richard Ellis

      I am have just started to teach myself about how to automate Office etc. I have found some knowledge base articles and am working my way throught them. Presently I am looking at Q179706 which talks about automatind Excel. About 30 or so rows into the sample code in the article is the following code snippet //Format A1:D1 as bold, vertical alignment = centre range = sheet.GetRange(COleVariant("A1"), COleVariant("D1")); font = range.GetFont(); font.SetBold(covTrue); range.SetVerticalAlignment(COleVariant((short) -4108)); //xlVAlignCentre = -4108 range is of type Range and sheet of type _Worksheet My question is this, how am I supposed to know xlVAlignCentre = -4108? I have searched files on my pc and MSDN for a definition or reference to where it is declared but turned up zip. I have found references to xlvAlignBottom etc on MSDN but nothing to tell me where they are stored or what their value is. Can anybody help? Thanks in advance Richard Ellis

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Neither the SDK or MFC contain that variable name, so I'd suggest that M$ have kindly let us know the hardcoded value of an internally used variable. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

      1 Reply Last reply
      0
      • R Richard Ellis

        I am have just started to teach myself about how to automate Office etc. I have found some knowledge base articles and am working my way throught them. Presently I am looking at Q179706 which talks about automatind Excel. About 30 or so rows into the sample code in the article is the following code snippet //Format A1:D1 as bold, vertical alignment = centre range = sheet.GetRange(COleVariant("A1"), COleVariant("D1")); font = range.GetFont(); font.SetBold(covTrue); range.SetVerticalAlignment(COleVariant((short) -4108)); //xlVAlignCentre = -4108 range is of type Range and sheet of type _Worksheet My question is this, how am I supposed to know xlVAlignCentre = -4108? I have searched files on my pc and MSDN for a definition or reference to where it is declared but turned up zip. I have found references to xlvAlignBottom etc on MSDN but nothing to tell me where they are stored or what their value is. Can anybody help? Thanks in advance Richard Ellis

        M Offline
        M Offline
        Masaaki Onishi
        wrote on last edited by
        #3

        Hello, the codegurus around the world.;) MSFT has some reference of this kind of value. I remembered that I downloaded some file. VB has some good example of these values definition. Try to find Automation sample by VB. X| Have a nice day!

        -Masaaki Onishi-

        1 Reply Last reply
        0
        • R Richard Ellis

          I am have just started to teach myself about how to automate Office etc. I have found some knowledge base articles and am working my way throught them. Presently I am looking at Q179706 which talks about automatind Excel. About 30 or so rows into the sample code in the article is the following code snippet //Format A1:D1 as bold, vertical alignment = centre range = sheet.GetRange(COleVariant("A1"), COleVariant("D1")); font = range.GetFont(); font.SetBold(covTrue); range.SetVerticalAlignment(COleVariant((short) -4108)); //xlVAlignCentre = -4108 range is of type Range and sheet of type _Worksheet My question is this, how am I supposed to know xlVAlignCentre = -4108? I have searched files on my pc and MSDN for a definition or reference to where it is declared but turned up zip. I have found references to xlvAlignBottom etc on MSDN but nothing to tell me where they are stored or what their value is. Can anybody help? Thanks in advance Richard Ellis

          R Offline
          R Offline
          Richard Ellis
          wrote on last edited by
          #4

          Thanks for the prompt responses Christian and Masaaki I had feared as Christian suggested but Masaaki's post got me to looking further. I eventually came across Q189265 which listed some Microsoft Graph constants. Then it said "you can see the constants available with Microsoft Graph by using the OLE - Com Viewer that is available with VC++ in the Platform SDK." So I did and after a bit of searching I found the constants I was after. Thanks again for the suggestions :) Richard Ellis

          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