Solved

Custom document properties in office

Posted on 2002-06-20
3
272 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

785 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