AlexBB

Trying to compile this sttemet:

Microsoft.Office.Tools.Word.Document doc = new Microsoft.Office.Tools.Word.Document ( );

I got an error:

Error 1 The type 'Microsoft.VisualStudio.Tools.Applications.Runtime.BindableComponent' is defined
in an assembly that is not referenced. You must add a reference to assembly

'Microsoft.VisualStudio.Tools.Applications.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I have "Microsoft.Office.Tools.Word.dll" added to References. I have "using Microsoft.Office.Tools;" namespace declared.

How can I add this reference to the Assembly

There were a few other errors related to similar objects but those I can figure out if shown how to do this one. I am a copycat by natureSmile

Thanks.




Re: Visual Studio Tools for Office Assembly Info Missing

TaylorMichaelL

It is part of VSTO. I assume you are already using VSTO as the class you're using is also a part of it. I'm not quite sure where the assembly lies as I'm not at a machine with it installed. If it isn't in the GAC then try <VSDIR>\Visual studio Tools for Office or <VSDIR>\Common7\IDE\PublicAssemblies.

Michael Taylor - 10/21/07

http://p3net.mvps.org





Re: Visual Studio Tools for Office Assembly Info Missing

AlexBB

TaylorMichaelL wrote:

It is part of VSTO. I assume you are already using VSTO as the class you're using is also a part of it. I'm not quite sure where the assembly lies as I'm not at a machine with it installed. If it isn't in the GAC then try <VSDIR>\Visual studio Tools for Office or <VSDIR>\Common7\IDE\PublicAssemblies.

Michael Taylor - 10/21/07

http://p3net.mvps.org

Thanks you Michael,

So, it is a dll: 'Microsoft.VisualStudio.Tools.Applications.Runtime.dll.' I did not realize that. I thought the message meant that I should add a line to the Assembly.cs file or something.

That is easier. Nope, I do not have this DLL anywhere in my system at all. I have three or four partitions: Vista Business, WindowsServer2003, XP and I could not find it anywhere. I have full blown Office installed at XP since it came free but now it seems to be a separate charge. Plus I am reluctant to put too much software into this OS because it slows it down. I use Office per say very seldom, mostly MSWord, although I used some DLLs Office related dlls for other things.

I have all DLLs colelcted for years in a separate directory and there is no such file in there.

Anyhow I have this question: My goal was actually to attach an Office Speller to an RTF richTextBox. Is it the right way to go via this route

What other options do I have. There is a speller in Outlook, there must be some spellers elsewhere in the system.

I installed a Vista Ultimate at my home machine a couple of days ago since business is no longer available I think. It has this Journal application. I am not sure it has a speller. If it does, shall I upgrade this machine to Ultimate

Many thanks, you've been always helpful.

I will keep investigating my options as well but your word will be most helpful and it saves valuable time.






Re: Visual Studio Tools for Office Assembly Info Missing

TaylorMichaelL

Well you forced me to go looking for it. I don't have VSTO installed on either of my VS2005 builds. On my VS2008 build it is in the GAC. Since VS2008 should be using the same version as VS2005 you should look there. I believe I remember that VS2005 shipped with support for Office 2003 so you have to download the VSTO for later versions of Office. It might be in there. The design time component, FYI, is in <VSDir>\Common7\PublicAssemblies.

As for the spellchecker I don't really know. There are third-party vendors who have controls for spellchecking in textboxes that you could use. Then again Word does already have that as well so using COM to load up Word to spellcheck, while overly complex and perhaps wasteful of resources, would work. I know that I've seen that done in an app or two. If this is for a home project or something then you should be okay as you won't notice but if you were to drop this into a commercial app it might not work so well. You'll have to play around with it to verify it works the way you want.


The other thing to consider is the dictionary. If you attach yourself to Word then the user's Word dictionary is used for spell checking. This might or might not be what you wanted. If the user wants to add more words to their dictionary they would have to go to Word or you would have to extend your app to expose Word for this.

If you are not interested in really using Word's dictionary then writing a spell checker isn't that hard. It is just a comparison of all words not in a list. The difficulty comes in doing it efficiently and for ignoring things like proper nouns, those containing numbers, etc.

As for Vista, business is still around. I have it on my company notebook. Ultimate is nicer if you have the hardware to run it. Enterprise is nice too if you have a license for it. Ultimately they are all the same code base (and in fact the same install). Changing the product key changes the version you have and the options available.

One thing about Vista I should warn you about (beyond everything you've read) is that searching for files is all but futile. You either have to waste space and CPU usage on indexing the entire system or live with the fact that it'll only search documents. Hence searching for assemblies or source files with certain entries is all but useless. Beyond anything the new search in Vista is horrible. That's why I can't say for certain whether I have the VSTO stuff on my VS2005 machines or not. I can't search for the assembly without indexing my entire drive and it won't find it reliably without indexing.

Michael Taylor - 10/22/07

http://p3net.mvps.org





Re: Visual Studio Tools for Office Assembly Info Missing

AlexBB

TaylorMichaelL wrote:

Well you forced me to go looking for it. I don't have VSTO installed on either of my VS2005 builds. On my VS2008 build it is in the GAC. Since VS2008 should be using the same version as VS2005 you should look there. I believe I remember that VS2005 shipped with support for Office 2003 so you have to download the VSTO for later versions of Office. It might be in there. The design time component, FYI, is in <VSDir>\Common7\PublicAssemblies.

As for the spellchecker I don't really know. There are third-party vendors who have controls for spellchecking in textboxes that you could use. Then again Word does already have that as well so using COM to load up Word to spellcheck, while overly complex and perhaps wasteful of resources, would work. I know that I've seen that done in an app or two. If this is for a home project or something then you should be okay as you won't notice but if you were to drop this into a commercial app it might not work so well. You'll have to play around with it to verify it works the way you want.


The other thing to consider is the dictionary. If you attach yourself to Word then the user's Word dictionary is used for spell checking. This might or might not be what you wanted. If the user wants to add more words to their dictionary they would have to go to Word or you would have to extend your app to expose Word for this.

If you are not interested in really using Word's dictionary then writing a spell checker isn't that hard. It is just a comparison of all words not in a list. The difficulty comes in doing it efficiently and for ignoring things like proper nouns, those containing numbers, etc.

As for Vista, business is still around. I have it on my company notebook. Ultimate is nicer if you have the hardware to run it. Enterprise is nice too if you have a license for it. Ultimately they are all the same code base (and in fact the same install). Changing the product key changes the version you have and the options available.

One thing about Vista I should warn you about (beyond everything you've read) is that searching for files is all but futile. You either have to waste space and CPU usage on indexing the entire system or live with the fact that it'll only search documents. Hence searching for assemblies or source files with certain entries is all but useless. Beyond anything the new search in Vista is horrible. That's why I can't say for certain whether I have the VSTO stuff on my VS2005 machines or not. I can't search for the assembly without indexing my entire drive and it won't find it reliably without indexing.

Michael Taylor - 10/22/07

http://p3net.mvps.org

Michael, thank you. I will continue searching. This info is very valuable because you weigh various options agains each other and only personal experience can give that. As I said, it saves time. I kind of felt guilty that I 'forced" you to do something but I am sure other people will read it and learn. Recently a guy found a post of mine of more than a year hereto and asked if I solved that problem, he had exactly the same. I could hardly remember what it was all about but next day I did and posted an answer. The problem of course was resolved long ago.

That comment of yours on the Vista search is also cute. I noticed it was fishy--too fast and suspiciously short list of the result. I do have an app I wrote that does a thorough search of all directories, memoriizes them in a table with all file extensions posted in a separate field. Thus if I need a dll file only such directoreis are looked in where dll's were once found and it is very fast. I refresh this DB once in two weeks. It does not seem to have this file.

I am weary of third party apps. At least MS software won't have any spybots in it.

I will keep evaluating my options.

Many thanks.






Re: Visual Studio Tools for Office Assembly Info Missing

AlexBB

OK, I did find this file after all. I found it in "Program Files\Common Files\Microsoft Shared\VSTO\" directory not on my machine but on one of the external HD where I've been saving info for years. I have no idea where I copied it from. Now the compiler is asking me for another dll:

Error 3 The type 'Microsoft.Office.Interop.Word.DocumentEvents2_Event' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Office.Interop.Word, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

This one I definitely could not find anywhere so far.

Michael, are you familiar with this one My understanding is this is the last obstacle. No more errors in the compiler.

Many thanks.






Re: Visual Studio Tools for Office Assembly Info Missing

Cindy Meister

AlexBB wrote:

I have full blown Office installed at XP since it came free but now it seems to be a separate charge.

Anyhow I have this question: My goal was actually to attach an Office Speller to an RTF richTextBox. Is it the right way to go via this route

No, VSTO is not what you need. VSTO mainly is for providing a user interface, not for automation. Here's an article that describes how you can use Word for spell checking from another application. It was written for the classic VB world, but it does give you the basics

http://support.microsoft.com/kb/243844/en-us

For information on how to automate Word, generally

VB.NET: http://support.microsoft.com/kb/316383/en-us

C#: http://support.microsoft.com/search/default.aspx catalog=LCID%3D1033&spid=global&query=automate+Word+C%23&adv=&ast=1%2C2%2C3%2C8%2C9&mode=a&cat=False&kt=ALL&title=false&mdt=&pwt=False&res=20&1033comm=1






Re: Visual Studio Tools for Office Assembly Info Missing

Mary Lee - MSFT

Alex,

there is a help topic to provide installation instructions for Visual Studio Tools for Office and its prerequisites such as the Office Primary Interop Assemblies. you can find the Office PIA download links for VS2005 at http://msdn2.microsoft.com/en-us/library/54ds2za4(VS.80).aspx

m.




Re: Visual Studio Tools for Office Assembly Info Missing

TaylorMichaelL

I'm not sure where that assembly is at. You aren't mixing the Word COM object with VSTO are you They are separate entities. As Cindy mentioned VSTO is generally used for add-ins to Office products rather than adding Office functionality to other apps. I had forgot about that. If you import the Word COM object then you'll just be referencing a single assembly instead. That is how we use to do things like save Word documents from our app. Not sure that you can get the spell checking functionality that you want though.

Michael Taylor - 10/24/07

http://p3net.mvps.org





Re: Visual Studio Tools for Office Assembly Info Missing

AlexBB

TaylorMichaelL wrote:

I'm not sure where that assembly is at. You aren't mixing the Word COM object with VSTO are you They are separate entities. As Cindy mentioned VSTO is generally used for add-ins to Office products rather than adding Office functionality to other apps. I had forgot about that. If you import the Word COM object then you'll just be referencing a single assembly instead. That is how we use to do things like save Word documents from our app. Not sure that you can get the spell checking functionality that you want though.

Michael Taylor - 10/24/07

http://p3net.mvps.org

Thanks Mary Lee, Cindy & Michael. Overwhelmed by the generous advice. I had been distracted by some OleDb related issues which I just resolved. Then I beautified my richTextBox Control. Now my attention will be at installing the Word. Actually I had done it all in the past weirdly. I clearly remember creting Word Documents out of some Visual Fox Pro 9 (I think) app. Perhaps I am mistaken, perhaps it was a different code. But I clearly remember having homemade documents and using spell check. Had no real use for it then and now I have no clue how I did it. I will have to retrace my steps. Obviously FoxPro is not an option. Does not want to work in Vista for me, no way. This is why I am in this poursuit.

I will brainstorm the links and may come back for more questions. Obviously I am confused all the way, as you Mike, suspect.






Re: Visual Studio Tools for Office Assembly Info Missing

AlexBB

The other thing to consider is the dictionary. If you attach yourself to Word then the user's Word dictionary is used for spell checking. This might or might not be what you wanted. If the user wants to add more words to their dictionary they would have to go to Word or you would have to extend your app to expose Word for this.

If you are not interested in really using Word's dictionary then writing a spell checker isn't that hard. It is just a comparison of all words not in a list. The difficulty comes in doing it efficiently and for ignoring things like proper nouns, those containing numbers, etc

Michael hi. Thanks for these two paragraphs. They were thought provoking. I thought to myslelf: why not The next day I had a plan and as of today I have an excellent spell checker that includes everything I've always wanted: all standard words of English language, custom added words, a special table where the API collects my misspelled words, it corrects them on the fly next time I goof up. All words are checked for misspell while I type. It is super fast.. The words are located in indexed tables where words are secregated by the length (number of characters). I am thinking what kind of other crazy ideas I can possibly implement because the options don't seem to have been exhausted. And I did not pay a cent for it, just my time.

Thanks.