Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Orthografic corrector
Message
 
 
To
20/01/2010 08:30:52
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01444897
Message ID:
01444918
Views:
37
Now I have the error message:

function name missing: iVersion = INT(VAL(.Version)


Below is the way I put both functions inside my function library file
FUNCTION SpellCheck
  LPARAMETERS vText as String
  LOCAL lcSource as String, loDoc AS Word.Document
  DO CASE
  CASE VARTYPE(m.vText) = [C]
    lcSource = m.vText
  CASE EMPTY(lcSource) AND !EMPTY(_CLIPTEXT)
    lcSource = _CLIPTEXT
  ENDCASE
  IF !EMPTY(lcSource) AND LoadWord() > 0
    loDoc = _screen.oWord.Documents.Add(,,1,.T.)
    loDoc.Content.Text = lcSource
    loDoc.CheckSpelling()
    lcSource = loDoc.Content.Text
    _screen.oWord.Visible = .F.
    loDoc.Close(.F.)
    loDoc = .NULL.
    _screen.oWord.Quit(.F.)
    _screen.oWord = .NULL.
    RELEASE loDoc
  ENDIF
  RETURN lcSource
ENDFUNC


FUNCTION LoadWord
	LOCAL liVersion as Integer, lcMsg as String
	liVersion = 0
	IF !PEMSTATUS(_screen,[oWord],5)
		_screen.AddProperty([oWord])
	ENDIF
	TRY
		_screen.oWord = CREATEOBJECT([Word.Application])
	CATCH
		TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3
			It seems, there is no MS WORD installed on your system.
			This App is needed to continue with the functionallity 
			you just wanted to use.
		ENDTEXT
		MESSAGEBOX(lcMsg,0+64+0,[Info])
	ENDTRY
	IF VARTYPE(_screen.oWord) = [O]
		WITH _screen.oWord
			IF INLIST(ALLTRIM(.version), [9.0], [10.0], [11.0], [12.0])
				liVersion = INT(VAL(.Version)
			ELSE
				TEXT TO lcMsg TEXTMERGE NOSHOW PRETEXT 3
					Please install a hight Version of MS WORD (9+)
					Otherwise, this feature is not available.
				ENDTEXT
				MESSAGEBOX(lcMsg,0+64+0,[Info])
				.Quit()
			ENDIF
		ENDWITH
	ENDIF
	RETURN liVersion
ENDFUNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform