General information
Category:
Coding, syntax & commands
>>>>Hello,
>>>>
>>>>Is there anybody who can help met kick-start with Word-Ole, because I need to fill the company name in a Word order document. Can I use the word fields, or is there a better way???
>>>>
>>>>Please help, any word ole example is appreciated...
>>>>TIA
>>>>Greetings,
>>>>Jean-Pierre
>>>
>>>Here word ole that use to open a file. I hope it can help you.
>>>
>>>MyOLe = CREATEOBJECT("Word.Basic")
>>>
>>>lsLanguage = MyOLe.appInfo(16) && Test if Word is french or english
>>>DO CASE
>>> CASE lsLanguage = "Français"
>>> lsFileOpen = "MyOLe.FichierOuvrir"
>>> lsAppMinimize = "MyOLe.FenAppRéduction"
>>> lsAppActivate = "MyOLe.AppActiver"
>>>
>>> CASE lsLanguage = "English"
>>> lsFileOpen = "MyOLe.FileOpen"
>>> lsAppMinimize = "MyOLe.AppMinimize"
>>> lsAppActivate = "MyOLe.AppActivate"
>>>
>>> OTHERWISE
>>>
>>> RETURN
>>>ENDCASE
>>>
>>>MyFile = "c:\temp\temp.doc"
>>>MyFile = ["] + MyFile + ["]
>>>
>>>&lsFileOpen. (MyFile, 0) && Modele, nouvModel
>>>
>>>bMyMinimize = IIF (&lsAppMinimize.() = 0, .F., .T.)
>>>IF bMyMinimize
>>> &AppMinimize. && Fera un restore
>>>ENDIF
>>>&lsAppActivate. ("",1) && le 1 indique le moment, 1 -> now
>>
>>Thanks Michel for your example, but when I try MyOLe.appInfo(16) I get an error:
>>OLE error 0x80020006 Unknown name... What am I doing wrong ???
>
>Try without it, in the sample replace it by lsLanguage = "English". You can find more info in the file \msOffice\winword\Wrdbasic.hlp
Sorry, but what I didn't mention is that I'm using Word (dutch) for Win95 (this might be essential...) An other question is where can I find the translations for the ole commands, because of the localized version. I have the AppInfo on an english version of Word 7 but that ditn't work either... Again what am I doing wrong??? Please show me the way with more examples...
TIA
Previous
Next
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