Sample code for Smart Documents

N

Nick Danger

Is there somewhere where I can download some sample code for using Smart
Document support with Word 2003 and C++ in Visual Studio 2005?

I've found code for Excel, I've found code for VisualStudio 6.0, I've found
code for VBA, but nothing for this particular combination. For someone just
getting started with this stuff, porting is a nontrivial operation.
 
C

Cindy M.

Hi Nick,
Is there somewhere where I can download some sample code for using Smart
Document support with Word 2003 and C++ in Visual Studio 2005?

I've found code for Excel, I've found code for VisualStudio 6.0, I've found
code for VBA, but nothing for this particular combination. For someone just
getting started with this stuff, porting is a nontrivial operation.
I doubt whether you found an example for VBA, seeing as this requires a DLL
and VBA only executes from within an Office document. In any case, start here

http://msdn.microsoft.com/library/en-us/sdsdk/html/sdhowTutorialCPPIntroductio
n_HV01079936

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
N

Nick Danger

Cindy M. said:
Hi Nick,

I doubt whether you found an example for VBA, seeing as this requires a
DLL
and VBA only executes from within an Office document. In any case, start
here

http://msdn.microsoft.com/library/en-us/sdsdk/html/sdhowTutorialCPPIntroductio
n_HV01079936

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)

That URL gets a 404.
Cindy, I appreciate your taking the time to respond, but I really have to do
a little bit of ranting here. This is typical of every lead I've tried to
follow. It's all broken links, things that don't compile properly, things
that are based on back-level versions of one product or another, or finding
a post in a discussion group where someone asked the same question two years
ago that I have now, and no one answered.

Right now, I'm trying to work with the samples in the Microsoft Office 2003
Smart Document SDK. If I open SimpleSample.doc in any of the samples
directories, I get a popup message saying:
"This document works best when you use an up-to-date XML expansion pack
from:
C:\Program Files\Microsoft office 2003 Developer Resources\Microsoft Office
2003 Smaqrt Document SDK\samples\SimpleSampleCP\manifest.xml.
Do you want to download the XML expansion pack?"

If I say Yes, it comes back with:

"The file could not be installed because there was a problem with the
security certificate. The XML expansion pack may not work as expected. For
more information, contact your administrator."

A quick google search produces a couple hits, but nothing useful.

If I create the impression that I am sitting here, turning purple, foam
spewing out of my mouth, veins in my neck bulging, fingers twitching with
anger as I type this, ... well actually, come to think of it, that probably
is an accurate description. But please be assured that this rage is not
directed at anyone in this newsgroup. Any efforts to help will be sincerely
appreciated.
 
C

Cindy M.

Hi Nick,
That URL gets a 404.
I was viewing the page when I copied the URL to my reply. So it is definitely
valid and exists. In the message I see, it's broken to a second line, so you
may need to do some patching together.
Right now, I'm trying to work with the samples in the Microsoft Office 2003
Smart Document SDK.
I imagine that's the link I posted...
"The file could not be installed because there was a problem with the
security certificate. The XML expansion pack may not work as expected. For
more information, contact your administrator."
Can't help you here. I gave up on SmartDocuments long ago because this part
is just so complex, intransparent and intractable. Took a course, once, and
of course deployment was the last bit. The samples there didn't work, either,
and the instructor just walked out the door when time was up.

FWIW "Office 2003 will not allow an XML expansion pack manifest file to load
unless it has been signed by a publisher that is trusted on the local
computer. If the file is signed but the publisher is not in the list of
trusted publishers, the user is asked whether they wish to add this publisher
to the list. If the file is not signed or the user does not trust the
publisher, it will not load and the smart functionality of the Office
document will not be available to the user."

Sounds to me like the certificate with which this manifest was signed is
invalid - meaning there's nothing you can do to get this sample to load
(unless not updating the manifest helps). Or you could try signing the
manifest with your own certificate.

The VSTO 2005 product makes life so much simpler for most of this. But of
course that's .NET Framework.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
D

Doug Robbins - Word MVP

Hi Cindy,

FWIW, I could not get to the page when you first posted your message
containing the link or again now. And, I did put the link back together.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Cindy M.

Hi Doug,
FWIW, I could not get to the page when you first posted your message
containing the link or again now. And, I did put the link back together.
<Hmph>Doesn't work for me today, either.
OK, how about this one
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdsdk/html/
sdhowTutorialCPPCreatingTheDLL_HV01079935.asp

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
N

Nick Danger

Right now, I just want to get past the problem with the digital certificate.
The messages are completely cryptic. It looks like it's trying to read it
directly from my disk, which may explain why it's having problems getting
the certificate. I've done everything I can think of to disable security,
but to no avail. From what I've seen in Google and Google Groups, it looks
like others have had the same problem but the only responses anyone can
offer are things that don't work and the ever popular RTFM. All I'm trying
to do is run some samples distributed by Microsoft, following the directions
supplied by Microsoft, using tools and products that come from Microsoft. Is
there anyone who can tell me step by step how to get around this problem?
 
C

Cindy M.

Hi Nick,
Right now, I just want to get past the problem with the digital certificate.
The messages are completely cryptic. It looks like it's trying to read it
directly from my disk, which may explain why it's having problems getting
the certificate. I've done everything I can think of to disable security,
but to no avail. From what I've seen in Google and Google Groups, it looks
like others have had the same problem but the only responses anyone can
offer are things that don't work and the ever popular RTFM. All I'm trying
to do is run some samples distributed by Microsoft, following the directions
supplied by Microsoft, using tools and products that come from Microsoft. Is
there anyone who can tell me step by step how to get around this problem?
The only thing I can suggest is to contact Microsoft support and open an
incident. If it's a bug on the Microsoft side, the costs will be returned. If
you have an MSDN subscription, then you can get free assistance by logging in
over the MSDN site and posting through the support interface there.

To get around the manifest security checks, see this page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdsdk/html/sdh
owTutorialDisableManifestReg_HV01075000.asp

That's referenced from this step (6) in the tutorial link I gave you
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdsdk/html/sdh
owTutorialCPPTestTroubleshoot_HV01088306.asp

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
N

Nick Danger

Cindy M. said:
Hi Nick,

The only thing I can suggest is to contact Microsoft support and open an
incident. If it's a bug on the Microsoft side, the costs will be returned.
If
you have an MSDN subscription, then you can get free assistance by logging
in
over the MSDN site and posting through the support interface there.

To get around the manifest security checks, see this page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdsdk/html/sdh
owTutorialDisableManifestReg_HV01075000.asp

That's referenced from this step (6) in the tutorial link I gave you
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdsdk/html/sdh
owTutorialCPPTestTroubleshoot_HV01088306.asp

OK - we're making some progress now. The registry update took care of that
problem. Thanks, Cindy. Now I get:

The file could not be installed because of missing internal setup logic. The
solution may not work as expected. Contact your administrator for further
information.

I was only able to find two hits in Google - one from MSDN that said a
regsvr32 command failed (no clue how to find out what the command was, why
it failed, or what to do about it), and a newsgroup post from January 2004,
where someone got the same thing and wanted to know what to do. No one
responded. So, at the risk of making an even greater nuisance of myself, I'm
coming back here to see if anyone has some useful advice to offer.
 
P

Peter Jamieson

There could well be a problem in the manifest file, whose structure is also
not particularly well documented. If you can post yours here I may be able
to spot something, but my memory of this stuff is now pretty vague.

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top