Solved

Custom document properties in office

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Copy exact format 27 99
Always hangs on opening 8 54
excell formula 4 22
Microsoft Access 2010, using same Header 4 40
Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now