In an effort to learn (alot) more VB, I am thinking of making a
small dictionary utility.
My question is, can you 'tap' into the MSWord dictionary
without running the MSWord App?
I'm also open to suggestions :)
Cheers,
Bruce.
________
Hot_Zouvineir
Printable View
In an effort to learn (alot) more VB, I am thinking of making a
small dictionary utility.
My question is, can you 'tap' into the MSWord dictionary
without running the MSWord App?
I'm also open to suggestions :)
Cheers,
Bruce.
________
Hot_Zouvineir
Sorry, I also ment to say, if opening MSWord was the only way
to go, can it be done in the background.
The idea being a simple form, with a text box containg the
search string, and a results/suggestion list.
Bruce.
________
HERBALAIRE VAPORIZER
In word, you can do it like this:
VB Code:
Dim wdApp As New Word Set sugList = wdApp.GetSpellingSuggestions("homicydal") If sugList.Count = 0 Then MsgBox "No suggestions were found" Else For Each sug In sugList MsgBox sug.Name Next sug End If
Something like that ;)
Sorry Dave, Forgive my ignorance :)
Does your example go in VB or Word?
Cheers
Bruce.
Word, What version of word do you have?
You can put that into VB with a few modifications
1. In visual basic, click Project (menu) then References,
2. Add a reference to Microsoft Word 9.0 Object Library
3. Add a textbox called txtStr to your VB form
3. Add a listbox called lstSug to your VB form
4. Add the following code to your VB form
VB Code:
Dim wdApp As New Word.Application Dim wdDoc As Word.Document Private Sub Form_Load() Set wdDoc = wdApp.Documents.Add txtStr = "" End Sub Private Sub Form_Unload(Cancel As Integer) 'Clean up Set wdDoc = Nothing Set wdApp = Nothing End Sub Private Sub txtStr_Change() lstSug.Clear Set sugList = wdApp.GetSpellingSuggestions(txtStr) 'Get the suggestions If sugList.Count = 0 Then lstSug.AddItem "No suggestions were found" Else For Each sug In sugList lstSug.AddItem sug.Name Next sug End If End Sub
It will find suggestions for all new input in the textbox ;)
Ahhh,
Things are alot clearer now! Cheers.
I have Office 97.
What I can't seem to find is the Microsoft Word 9.0 Object Library
reference. It's not in my list.
Bruce.
________
California Medical Marijuana Dispensaries
Then go down a version...
Maybe Word 8.0 Object Library?
That did it.
I must be blind, I didn't even see the reference to Word 8!
Works fine :) (slight glitch I'll iron out).
Anyway, did you just knock up that code or did you have it coded
already?
Well, Thanks for your help Dave.
Bruce.
________
SophiaHot
Just knock it up before
When closing this app (using the x)
I notice 'Winword' is still active (using Ctrl-Alt-Del).
I have unsuccesfully tried adding to the Form_Unload sub.
the following in an attempt to close off Winword:
Set wdDoc.Close, Set wdApp.Application.close
wdDoc.Close = true......... Clutching at straws!
Hmmmmm.
I have done a search, and I have found heaps using
Kill, Public Function.... yada yada yada.
They seem to deal with Active windows apps though.
Bruce :)
________
HOW TO ROLL A JOINT
Application.Quit should work...
I don't know if i've declared Word correctly :rolleyes:
The word declaration is OK.
Had to use:
Word.Application.Quit
in the Unload_Form aswell to close of Winword.
Thanks again.
Bruce :)
________
lesbians Webcam
Yeah, woops, thought i had put that in :rolleyes: