Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Word 6, 7, or 8???
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00173965
Message ID:
00175812
Views:
30
>Here's a modified function - normally it creates and returns a suitable vfpWord object but I've trimmed it for more general use. It's not pretty though - also watch out - MS have changed some of the return values (e.g. from English (UK) to English (British) so you'll have to play around a little). I imagine you'll get "Svensk" for Swedish Word.
>
>
>This works with Word 6.0, 95 and 97 in both English and Danish (well, alright, I haven't tested 6.0 in Danish). I've not been able to get the OLELocale, etc., working with 6.0 or 95.
>
>Hope it helps.
>
>
>
>function makeSqaWord
>lparameter wo
>local o, s
>* given a valid word.basic object, creates and returns
>* the appropriate class...
>
>* Word has .appInfo or .progInfo (or whatever) depending on the language
>* can't tell until you try and then raise the error...
>
> on error oleErrorHandler()
> swutil_iInfo = 0
> s = "*"
>
>* fetch the language so we know what we're dealing with...
>
> do while s = "*"
> do case
> case swutil_iInfo = 0
> s = wo.appInfo(16)
> case swutil_iInfo = 1
> s = wo.progInfo(16)
> otherwise
> s = ""
> endcase
> enddo
>
>* now we've got the language, fetch the version using the correct appinfo
>* or progInfo or whatever...
>
> local nWordVer
> do case
> case (s = "English (AUS)") or (s = "English (UK)") ;
> or (s = "English (US)")
> nWordVer = val(wo.appInfo(2))
> if nWordVer < 8
> *word 6 or whatever...
> else
> * word 97...
> endif
> *messageBox("would create English version")
>
> case (s = "English (British)" ) && probably Word97
> * probably word 97...
>
>
> case (s = "Dansk")
> *messageBox("would create DANISH version")
> nWordVer = val(wo.appInfo(2))
> if nWordVer < 8
> * word 6 or whatever...
> else
> * word 97...
> endif
>
> otherwise
> *messageBox("Unknown type - FAILED!")
> *...
> endcase
> *on error...restore your error handler here...
> return &&...whatever...
>endfunc
>
>function oleErrorHandler
> swutil_iInfo = swutil_iInfo+1
>endfunc

Hi Robert.

This works fine except for the fact that ProgInfo in the swedish version of
Word 6 is called PrgmInfo. This is not fun since my app is going to be
translated and run in 7 different languages. Is this a fact that in every
version of Word 6 ProgInfo is called something different?

/Magnus
Magnus Nordin
VFP MCP

"We have tested the GUI on 5-year olds. Why? Beacuse they aren't braindead!"
Michael Spindler, Apple

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform