Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about Smart Tag SDK and Word 2007

9 views
Skip to first unread message

Kilgore3000

unread,
Jun 26, 2009, 3:04:01 AM6/26/09
to

I have downloaded the C# tutorial from the Smart Tag SDK
[http://msdn.microsoft.com/en-us/library/aa296266(office.11).aspx] however
the smart tags are not recognized by MS Word.

The smart tags do not appear in the Recognizers list of the AutoCorrect
dialog of Word.

I developed the add-in using Visual Studio 2008, .NET 3.5 and Office 2007. I
am using the Smart Tag SDK instead of VSTO because I intend the Smart Tags to
eventually be used by Outlook. (And Outlook uses Word as its editor)

I have verified that the registry entries are correct, the path used by the
Filename registry entries is correct, the "Label text with smart tags" and
"Show Smart Tag Action buttons" items in Word are selected on the
"AutoCorrect" dialog.

The one deviation I made from the tutorial example is that I am using the
v2.0.50727 version of the CASPOL.exe instead of the v1.1.4322 version since
the target framework for the add-in is set to .NET version 3.5.

Could someone please give me some guidance on why the Smart Tags are not
being loaded?

Thanks

Kilgore3000

unread,
Jun 26, 2009, 4:40:03 PM6/26/09
to

The problem was a security issue. I was not able to set the .NET security
using caspol.exe as described by tutorial. I was able to resolve the problem
in two steps described below.

1) Sign the .dll created in the tutorial

2) Use the .NET 2.0 Configuration Tool to give the assembly full trust

Step 1:
I signed the dll in Visual Studio 2008 doing the following:

Project Properties | Signing tab | Select "Sign the assembly"

and supplying a name and password for the key file.

Then rebuild the assembly.

Step 2:
Open the .Net 2.0 Configuration Tool
(If it is not on your system you will need to download the .NET Framework
2.0 Software Development Kit:
http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en

Expand down to "Runtime Security Policy"

Right-Click on "Runtime Security Policy" -> "Trust an Assembly"

Select "Make changes to this computer"

Browse to the assembly dll

Select "This one assembly"

Raise the slider to "Full Trust"

Then click Finish

- - - -

After performing these actions I was able to get the C# Smart Tag tutorial
to work in Word and in a new e-mail from Outlook.

"Kilgore3000" wrote:

> I have downloaded the C# tutorial from the Smart Tag SDK
> [http://msdn.microsoft.com/en-us/library/aa296266(office.11).aspx] however

> the smart tags are not recognized by MS Word . . .
>

Kilgore3000

unread,
Jun 29, 2009, 9:55:02 PM6/29/09
to


"Kilgore3000" wrote:
Please ignore my last post:

>
> The problem was a security issue. I was not able to set the .NET security
> using caspol.exe as described by tutorial. I was able to resolve the problem

> in two steps described below.....
>

The solution I provided is not correct. I'm not sure what exactly the
original problem why I could not run the SDK code. However there are a few
issues with Visual C# example (SimpleCSharpST) installed by the Microsoft
Office 2003 Smart Tag SDK.

Issue #1:
The registration files in the SimpleCSharpST are incorrect if you followed
the instructions in the readme.rtf file.

Issue #2:
The source files contained in the zip file:

Visual C# Sample\SimpleCSharpST\SimpleCSharpST.zip

contains an error that will prevent the example from working correctly.


Each of these issues is described further detail below.

I downloaded the Smart Tag SDK from:

http://www.microsoft.com/downloads/details.aspx?familyid=c6189658-d915-4140-908a-9a0114953721&displaylang=en

The Microsoft Office 2003 Smart Tag SDK that I was working with has a readme
file with the date 12/18/2003. These comments refer to that version. After
installing the SDK, I worked with the C# tutorial (Simple CSharpST) example.

The first source of possible confusion is the tutorial supplies two sets of
registration/bat files and unregistration/bat files that create "Filename"
registry entries pointing to different directories.

One registration file is SimpleCSharpST/RegSimpleCSharpST.bat and it creates
registry entries for the "Filename" registry key with a path starting with:

C:\SimpleCSharpST

The second registration file is SimpleCSharpST/Install/RegSimpleCSharpST.bat
and it creates registry entries for the "Filename" registry key with a path
starting with:

C:\Program Files

Furthermore, the Microsoft Office 2003 Smart Tag SDK\readme.rtf file states:

"The samples included with this SDK include batch files that automatically
register the smart tag samples with the default installation directory of
C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office
2003 Smart Tag SDK\."

So the registration files in the SimpleCSharpST are incorrect if you
followed the instructions in the readme.rtf file.

The second source of confusion is the presence of a SimpleCSharp.zip file in
the directory:

Visual C# Sample\SimpleCSharpST

I had assumed that this was just a zipped up file of the SimpleCSharpST
folder and that the files were identical to what had been installed. This
assumption was false. The source is different and will actually not work
since there is an error in the method CSharpSTRecognizer.Recognize2 which
incorrectly specifies the tag:

"schemas-contoso-com/contoso#trees"

instead of the correct tag:

"schemas-contoso-com/contoso#color"

Again, this problem only is present in the zip file:

Visual C# Sample\SimpleCSharpST\SimpleCSharpST.zip

The source files in:

Visual C# Sample\SimpleCSharpST

are fine.

In conclusion, be sure to double-check the "Filename" registry key created
by the registration or bat files that you use and verify that they correctly
point to the .dll that is built. And delete or move the second set of
registration files that are irrelevant since you may accidentally use them,
which I suspect was my problem why I could not initially get the example to
work for me.


0 new messages