PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → work with Word; who can help ?
work with Word; who can help ?
Iniciado por Udo Libbach, 04,ago. 2004 17:11 - 1 respuesta
Publicado el 04,agosto 2004 - 17:11
the following Example give me an Error.
I read an old Document and will save the Document
with SaveAs.
The Error is:
Error in Exit of Edit3 process, line 17.
Object handled by FileName method is not an Automation object.


Example-------------------------------------------------
NewDocument is string = "C:\FUHR\ORDER\test.rtf"
MyWord is object Automation dynamic
// If Word is already running, we'll use it
MyWord = GetActiveObject("Word.Application")
IF MyWord = Null THEN
// Word is not running: we run it
MyWord = new object Automation "Word.Application"
IF MyWord = Null THEN
Error("Cannot run Word")
RETURN
END
END
IF MyWord <> Null THEN
// Open old Document
MyWord>>Documents>>Open(rtfDocument)
// Save as < >
MyWord>>Documents>>Add>>SaveAs>>FileName(NewDocument)
// Open Document
MyWord>>Documents>>Open(NewDocument)


// Change Variable
// DFA
_neu is string = Edit6
MyWord>>Selection>>Find>>Execute("@DR_DFA",False,True,False,False,False,True,1,False,_neu,2)


MyWord>>Visible = True

MyWord>>Documents>>Close>>SaveChange("wdSaveChanges")
MyWord>>ActiveWindow>>Close()
// Closing Word
MyWord>>Quit()
Publicado el 04,agosto 2004 - 20:34
Udo,
MyWord>>ActiveDocument>>SaveAs>>FileName(NewDocument)

works for me.
Regards,
Andy

"Udo Libbach" <Udo.Libbach@t-online.de> wrote:

// Save as < >
MyWord>>Documents>>Add>>SaveAs>>FileName(NewDocument)