No announcement yet.

Programming Microsoft Office: FAQ

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programming Microsoft Office: FAQ

    1. What is Microsoft Office(r)?
    Office, a registered trademark of Microsoft Corporation Redmond WA, is a brand name for a suite of Windows'
    desktop software products. While the products may be licensed separately,they are often bundled.

    Those four products are:
    • Microsoft Outlook(r). An Email client, calendar and contact manager
    • Microsoft Excel(r). A spreadsheet program.
    • Microsoft PowerPoint(r). A presentation manager for text and graphics
    • Microsoft Word. A word processor.

    All four Office products have a substantial portion of the market for those products.

    Microsoft Outlook Express, an email client, is not part of the Office Suite. It is actually part of the Internet Explorer browser software.

    2. Where do I get Microsoft Office?
    Licenses for all products, or bundled combinations of products, may be purchased on-line from Microsoft and at many software retailers. One or more of the Office Applications are often included with new computers as part of a "starter applications software package."

    Microsoft office products are not freeware; however, Mcirosoft does make "read only" versions of Word, Excel and PowerPoint available free for the download; these read-only versions do not permit modification of existing files or copies thereof. (These read-only versions are similar to the Adobe Acrobat(r) Viewer - you can view documents created by others, but cannot create or modify documents yourself).

    3. Why should I care about interfacing with Microsoft Office Products?
    Precisely because so many users have Microsoft Office products installed; it is ubiquitous. And because it is ubiquitous, users are already familoar with it.

    4. Does Microsoft publish and/or support interfaces to the Office Products?
    Yes. All supported interfaces utilize a Component Object Model. The Object Models are described on line at

    Excel 2007 Developer Reference

    Outlook 2007 Developer Reference

    Word 2007 Developer Reference

    Office 2003 PowerPoint object model

    Office 2007 Powerpoint Object Model

    Office 2010 PowerPoint Object Mode

    Much of the "2010" version Developer reference material is already on line. For Office 2010, is a good starter page.

    This page shows the following products as members of the office Suite:
    • Access 2010
    • Communicator 2010
    • Excel 2010
    • InfoPath 2010
    • Office 2010
    • OneNote 2010
    • Outlook 2010
    • PowerPoint 2010
    • Project 2010
    • Publisher 2010
    • SharePoint Workspace 2010
    • Visio 2010
    • Word 2010

    Microsoft has been very good about making the interfaces "backward compatible"; that is, newer versions add features without breaking the old features.

    4. Where can I get the necessary PowerBASIC "INCLUDE" files to work with Microsoft Office products?
    You may use the PowerBASIC COM Browser shipped with your compiler to generate INCLUDE files. You will only be able to generate INCLUDE files for the products you actually have installed on your system.

    5. Where can I get more information about interfacing with Office products?
    There are many books available, both for "Office" and for the individual products comprising the Office suite. Check your favorite online or brick-and-mortar bookstores.

    6. Can I interface with Microsoft Office products without using the COM interface?
    Not really. Microsoft tends to change the internal file structures of the Office data files with each release. However, they maintain consisitency and compatibility in the COM-based API.

    7. Who is the moderator of this forum, and what does he do?
    The current Moderator is Michael Mattias. The moderator does have the ability to move threads into (or out of) this forum; to edit others's posts; to delete posts. However, he does not intend to do anything but find posts in other forums which belong here and move them.

    However, "Source code" postings will remain in the source code forum, and future postings should continue to be made there rather than here.

    All the "regular" rules for the PowerBASIC Peer Support Forums apply in this Special Interest Forum.

    8. How do I get more information included in this FAQ document?
    Contact the moderator either by private message here or by email at [email protected] and he will see what he can do to obtain the information.

    The moderator also requests you notify him about threads found in other forums which belong here.
    Last edited by Michael Mattias; 27 Apr 2012, 08:33 AM. Reason: Update PowerPoint links

  • #2
    Useful applications posted in May 2012 (not in source code forum)

    Extract rows/item text from Microsoft Excel Spreadsheet (Kevin Brown)

    Extract text from Microsoft Word document files (Jean-Pierre Leroy)

    Extract text from Microsoft PowerPoint presentation files (Jean-Pierre Leroy)



    • #3
      Hi, the links are brocken, how to extract values from a cell was my problem some days ago, I found it in some posts by other users (get a variant, read the type of data, extract the data) ...
      but my problem is to understand the basics of the job, what choice in the com browser, ansi or wide and why ... dispatch or not ... and so on.
      when to use SET GET or CALL ... the basics of that ...

      Where can I find this documented ?



      • #4
        Originally posted by Hubert Brandel View Post
        Hi, the links are brocken,...
        Discussed recently in another couple of threads.
        Those links are to the old forum software.

        You can find old linked posts by changing the start of the URLs from

        ie the three posts linked by MCM in post #2 can now be found at


        • #5
          Thanks a lot, that helps



          • #6

            On your conversion suggestion, my first attempt to follow the instructions ...

            I converted this ...


            To this ...


            And, wouldn't you know, I got this

            Sorry, you are not authorized to view this page. For assistance contact the site administrator.


            • #7
              Originally posted by Gary Beene View Post

              On your conversion suggestion, my first attempt to follow the instructions ...

              I converted this ...


              To this ...


              And, wouldn't you know, I got this

              That's a link to the old Cafe PowerBasic. IIRC, you needed to opt in to view that forum.

              I see it:
              Attached Files


              • #8
                Here's that MCM post in full:

                One from column A, one from column B...

                11 Oct 2004, 03:08 AM

                First, I hope no one minds one post with a boatload of links.

                At I made the comment..

                You're not ever going to find 'exactly' what you want here. All the 'real' applications you will do will be created by selecting one from column A, one from column B and one from column C.

                Over the past couple of weeks I have been working on a 'real' application, and wanted to demonstrate how true this is.

                So let's start at the beginning and take a little trip.

                Application Description
                I wanted a "slide show" in which I could walk prospects thru the screens, reports, and text of things like the features and benefits for The Provider Payment Partner System

                I wanted to make this a single "exe" file users could run either from my website or I could send as a simple email attachment. I did not want to rely on anything special being installed on the user system, and because it might run from the Internet, I wanted the file to be "not too big" to allow for download time. Under no circumstances did I want to use PowerPoint(r), because A) you need to have PP or the free viewer installed to see a presentation and B) I am firmly convinced that the last thing any prospect wants to see is yet another PowerPoint application.

                I also figured that if I did this right the first time, I'd be able to easily reuse this to shamelessly promote some of my other products.

                So I put together a design before I even started looking for code....

                I'd create a window with these controls....
                - A control on which to display pictures and/or richtext documents (collectively, "slides")
                - A control in which I could add text commentary to accompany the slides.
                - Buttons to go to "next" or "previous" slide
                - Buttom to "exit now" (why anyone would not want to see all the goodies is beyond me, but a little voice in the back of my head said I should include this).

                Create Slides and commentary
                Richtext documents: I can create these with my word processor.

                Screen Shots and Other Pictures: Since both the screens and reports are generated by the program and in any event I did not want to show "blank" screens or "obvious test data" , the best I could do was to run the application, capture the screens and reports using the "print screen" key, paste the image into Microsoft "Paint" (the cheapie drawing program included with Windows), manually select/cut/paste to crop the images out of the larger bmp (the application is MDI and many windows can "collide"), and saving the picture file.

                Readily Apparent Challenges
                1. The "BMP" files I wanted to show totalled about 10 megabytes... way too big to make a decent demo. I'd have to find some way to make these smaller.
                2. I am the world's worst programmer when it comes to anything to do with Windows graphics calls, which I was pretty sure I would need to show BMP files on the screen.

                So, I set out to find the code I needed in Source code Forum.

                Compressing Picture Files
                At I describe all the compression code I tried and the results. (Includes links to all source code used). I got 'size greedy' and decided upon ZLIB.

                Showing a Picture File
                I found Mr. Tony Burcham's picture renderer at
                That program renders to the desktop DC, but I figured it "should" work to any DC.

                Packaging reports and richtext into a single EXE
                Sounded like a job for resources, so I used
                User-Defined Resource Demo January 26 2003
                (Yes, I know it's not fair to include this because it's my own code. Point is, that code's available to anyone).

                Rendering Rich text to the screen.
                In fact I had already downloaded some richtext display code I picked up from both Borje Hagsten and Don Dickinson http:// , and had implemented it in an application I had already created ( , "Tech Corner" tab, select "835did.exe", run and hit the "info" button).

                Oops, the compression I chose requires a third-party DLL. I wanted a single EXE file
                Well, I guess we'll have to make that a resource, too.

                So I kind of had the basics working. But as you all know well, once you have the basics working, you find things which don't quite work the way you thought (hoped?) they would.

                The picture won't refresh after you minimize and restore the main screen
                I immediately thought, "owner-draw" and Windows will tell me when to redraw. But how? Then I remembered that Borje Hagsten's very fine "RRButton" at uses owner-drawn buttons, so maybe that code would work the same for a static control with style SS_OWNERDRAW? Sure enough, it did.

                I wanted the left-and-right arrow keys to move thru the slides.
                I knew that anytime you want keys to do something non-standard you need something called "subclassing", and buttons (not in a dialog) react only to the spacebar key and mouse clicks. Found lots of stuff here on "subclassing". (OK, so I had found it all a couple years ago. It's still there).

                Then I decided tooltips over the buttons would be cool.
                No problem. I simply found and shamelessly appropriated Mr. William Burns' easy-to-use code at

                When you try to run the program at 800x600 resolution, it doesn't fit the screen very well
                If only I could detect the current video resolution, I could do something. Then I remembered a piece of code which detected the resolution of a printer... might that point me to the correct way to get the current screen resolution? Why, yes it did..Lee Furr's very nice piece at got me to where I needed to be.

                My Point?
                The application I ended up with (go to the PPPS web site ; near the bottom of the page is a link to "Take the PPPS Tour" and you can, well, 'take the tour') is as much the work of others as myself.

                Sure, it took a little work to eliminate the GLOBAL dataname conflicts, adapt some things for this specific application, and otherwise allow all these children to play well with each other, but what worthwhile thing doesn't take a little work? I did not have to discover or learn anything to make this work.. all I had to do was combine pre-existing code for which others had already done the basic research.
                So thanks to all those who contributed to the PPPS Tour application.
                (But no, you don't get a percentage.)

                [this message has been edited by michael mattias (edited october 10, 2004).]