General information
Category:
COM/DCOM and OLE Automation
On my quest to integrate MS Word spellchecking in my multi-user VFP6 app, I have tried adapting code from John Harvey's Word class. The code which appears below is activated by double-clicking an editbox containing the user's text in a single-form which includes an OLEContainer which contains a Word6document control. The project which is compiled as an .EXE, works on my local PC which has Word 97/v7 installed. It also works over the network which has Word version 6 on the server. But when I run it on a friend's PC, who has Word 97 installed, I get get mess: 'The Windows registration databasse not updated, use Word setup to do this'. This is frustrating because I assume that I am always activating the Winword.exe and Word.Basic class on the server, not the local machine.
Any ideas why this don't work?
Or even, how do you use Word's spellchecker in a multi-user app?
********************************
on error do showmess
set path to l:\sys\apps\msoffice
ddesetoption("SAFETY",.F.) &&prevent dialog prompt
channel = DDEINITIATE("l:\sys\apps\msoffice\WinWord","System")
IF channel < 0 && if channel can't be established just run Word
RUN /N2 l:\sys\apps\msoffice\WinWord.exe
channel = DDEINITIATE("l:\sys\apps\msoffice\WinWord","System")
ENDIF
oWordRef= GetObject('','word.basic')
WITH THISFORM.oWordDoc
.DoVerb(0)
.width=50
.height=20
dumpit=asummary
#DEFINE C_MESS1_LOC dumpit
oWordRef.Insert(C_MESS1_LOC)
oWordRef.EditGoTo("\StartofDoc")
on error do shchecked
oWordRef.ToolsSpelling
on error
oWordRef.editselectall
oWordRef.editcopy &&into clipboard
asummary=_cliptext
thisform.pageform1.page1.edtasummary7.value=asummary
ENDWITH
DDETERMINATE(channel) &&close channel
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only