Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Custom document properties in office

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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