mer. 18 février 2015, 11h35
Guy BONEMME
atoutfox.public.association
Word -> DBF
Bonjour Vilhelm-Ion
J'ai utilisé avec succès la routine transmises avec les instructions
suivantes:
*lcdoc = "c:\Vfox9\Apps\A_chf\CHF_BUL_2008_2.docx"
-----
Lorsque je veux utiliser un autre fichier ex:
cdoc = "c:\Vfox9\Apps\A_chf\CHF_BUL_2008_1.docx"
J'obtient à la ligne :
odoc = m.owrd.documents.open(m.lcdoc)
une erreur OLE m'indiquant fichier innexistant
et farfelu suivant des endroits ou il cherche
Je suppose que j'oublie une fonction de release object mais je ne
trouve pas
Merci
LOCAL lcdoc,owrd,omot, orevue, odoc
SET STEP ON
SET DEFAULT TO "c:\vfox9\Apps\A_chf\"
CREATE TABLE 2008_1 (cMot C(100),nPage I, nSuite N(6,0))
*lcdoc = "c:\Vfox9\Apps\A_chf\CHF_BUL_2008_1.docx"
lcdoc = "CHF_BUL_2008_1.docx"
owrd = CREATEOBJECT("word.application")
owrd.visible = .T.
odoc = m.owrd.documents.open(m.lcdoc)
x = 1
FOR EACH omot IN odoc.words
IF !EMPTY(m.omot.text)
INSERT INTO 2001_2 VALUES (m.omot.text,m.omot.Information(3),
m.omot.RECNO())
ENDIF
NEXT
GO TOP
? RECCOUNT()
BROWSE
Original
LOCAL lcdoc,owrd,omot
CREATE TABLE montab (cMot C(254),nPage I)
lcdoc = "e:\owrd.docx"
owrd = CREATEOBJECT("word.application")
owrd.visible = .T.
odoc = m.owrd.documents.open(m.lcdoc)
FOR EACH omot IN odoc.words
IF !EMPTY(m.omot.text)
INSERT INTO montab VALUES (m.omot.text,m.omot.Information(3))
ENDIF
NEXT
GO TOP
BROWSE
--
Guy BONEMME
Atoutfox
BEfox
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000015983