Problem with addinandsmarttagexamp, and ADXSmartTagRecognizeEventArgs

Add-in Express™ Support Service
That's what is more important than anything else

Problem with addinandsmarttagexamp, and ADXSmartTagRecognizeEventArgs
 
Anton


Guest


I am trying to use the example that can be downloaded at:

http://www.add-in-express.com/projects/addinandsmarttagexample.zip

I built it and registered it. When I open Word it tells me through a message box that the addin has not been started. Do you have a clue why?

I have another problem about the following code:

private void adxSmartTag1_Recognize(object sender, AddinExpress.SmartTag.ADXSmartTagRecognizeEventArgs e) {


string word = String.Empty, localText = e.Text;


It is a code from a smarttag used in word.
e.Text sometimes includes the text with some strange character sequence at the end of the string. I think it happens when you type a word and then hit spacebar. If you hit enter instead the strange character sequence is not added to the text. This makes it harder to locate the last word typed. Do you know why this happens?
Posted 07 Jan, 2006 16:13:24 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Anton.

I built it and registered it. When I open Word it tells me through a message box that the addin has not been started. Do you have a clue why?

Do you have both .NET Framework v.1.1 and v.2.0 installed on your PC?

As for the strange characters, I think this is a bug. You can use the code below to fix it.
char c = localText[localText.Length-1];
if (Convert.ToUInt16© == 65532)
{
localText = localText.Replace(c, ' ');
localText = localText.Trim();
}
Posted 08 Jan, 2006 08:05:18 Top
Anton


Guest


Yes I have both .NET Frameworks installed. Is this a problem?

I am trying to create a smarttag project that has access to the word application object. Is this the correct approach, that is to use this example as a base?
Posted 10 Jan, 2006 10:54:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Anton.

Yes, the problem is in both versions of .NET Framework on one PC.
You need to put the following configuration file to the Office installation folder:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v1.1.4322"/>
<supportedRuntime version="v1.0.3705"/>
</startup>
</configuration>

This file must be named 'winword.exe.config'. It will make Microsoft Word use .NET Framework v.1.1 only. You can use the similar configuration file for all Office applications. One more thing. I hope you have already installed the following updates:
http://www.microsoft.com/downloads/details.aspx?FamilyId=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en
http://support.microsoft.com/kb/908002

I am trying to create a smarttag project that has access to the word application object. Is this the correct approach, that is to use this example as a base?

Yes, correct.
Posted 10 Jan, 2006 12:38:41 Top
Anton


Guest


Will it also be a problem for users of my program if they have both .NET Frameworks installed? Or is it possible to let the setup program automatically take care of creating this configuration file?

Will such an automatic change of Office configuration cause an alert from anti-spyware or anti-virus programs?
Posted 12 Jan, 2006 14:45:04 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Anton.

Will it also be a problem for users of my program if they have both .NET Frameworks installed?

Yes, it can be a problem if they use other add-ins that have been designed for .NET Framework v.2.0. I would advise you to have two versions of your add-in for both .NET Frameworks.

Will such an automatic change of Office configuration cause an alert from anti-spyware or anti-virus programs?

You shouldn't change the configuration of Office automatically. I think it can be done by Administrator only. Again I would advise to have two add-in versions. In this case you can be sure that your add-in will not prevent user's add-ins from loading if they have been designed for .NET Framework v.2.0.
Posted 12 Jan, 2006 19:15:55 Top