?
Solved

Custom document properties in office

Posted on 2002-06-20
3
Medium Priority
?
287 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

801 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