Solved

Custom document properties in office

Posted on 2002-06-20
3
275 Views
Last Modified: 2008-02-01
  Hello:

   How can access to the custom document properties of an excel document from VC++.

   Thanks,

Jose.
0
Comment
Question by:fjsen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:Triskelion
ID: 7095763
As a start:
Have you looked into Excel Automation?
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q179706

I'm researching...
0
 
LVL 6

Accepted Solution

by:
Triskelion earned 100 total points
ID: 7095961
Once you hve created your automation project, the functions to get the properties are

VARIANT Workbook::GetTitle();
VARIANT Workbook::GetComments();
VARIANT Workbook::GetCreator();
VARIANT Workbook::GetKeywords();
VARIANT Workbook::GetName();
VARIANT Workbook::GetSubject();
... etc. ...
VARIANT Workbook::CustomDocumentProperties(const VARIANT& Index);
0
 

Author Comment

by:fjsen
ID: 7098051
I'm using smart pointers and there is an smart pointer called DocumentPropertiesPtr but I don't know how to use it. When I try this:

DocumentPropertiesPtr p= pWorkBook->CustomDocumentProperties;

   it returns a NULL pointer.

   But if i try this:

DispatchPtr p= pWorkBook->CustomDocumentProperties;

   it works fine, but I must access to methods and properties via IDispatch interface and its horrible.

   Thanks.
0

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question