Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ayuda con Office - Help with Office -
Message
 
 
À
20/11/2000 12:03:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00443687
Message ID:
00445610
Vues:
26
Hi!

Following is in the help for Word Basic:

-----------------
RUN method

Runs a Visual Basic macro.

Syntax

expression.Run(MacroName)

expression Required. An expression that returns an Application object.

MacroName Required String. The name of the macro. Can be any combination of template, module, and macro name. For example, the following statements are all valid.

Application.Run "Normal.Module1.MAIN"
Application.Run "MyProject.MyModule.MyProcedure"
Application.Run "'My Document.doc'!ThisModule.ThisProcedure"

If you specify the document name, your code can only run macros in documents related to the current context ¾ not just any macro in any document.

Remarks

Although Visual Basic code can call a macro directly (without this method being used), this method is useful when the macro name is stored in a variable (for more information, see the example for this topic). The following two statements are functionally equivalent:

Normal.Module2.Macro1
Application.Run MacroName:="Normal.Module2.Macro1"

You cannot pass parameters to a macro by using the Run method.

>Sorry. English not is my first language.
>
>As make I to call a macro recorded in a document of Word from VFP?.
>
>The idea is to pull up Word using automation from VFP. At once, open a document specifies and to call to the macro that this recorded in the one.
>
>oword = newobject("word.document")
>odoc = oword.application
>odoc.documents.open("c:\mis documentos\acuerdo.doc")
>*// Here, call macro
>odoc.visible = .t.
>
>I have attempted the following one:
>
>odoc.activedocument.NombreMacro(parametro1, parametro2), but it doesn't work.
>
>Notice: The macro should not be called in the method Open of the document, because some parameters should be passed.
>
>¿Como hago para llamar una macro grabada en un documento de Word desde VFP?.
>
>La idea es arrancar Word utilizado automatización desde VFP. Enseguida abrir un documento especifico y llamar a la macro que esta grabada en el.
>
>oword = newobject("word.document")
>odoc = oword.application
>odoc.documents.open("c:\mis documentos\acuerdo.doc")
>*// Aqui se debe llamar la macro y pasarle unos parametros.
>odoc.visible = .t.
>
>He intentado los siguiente:
>odoc.activedocument.NombreMacro(parametro1, parametro2), pero no funciona.
>
>Nota: No se debe llamar la macro en el metodo Open del documento, pues se le deben pasar unos parametros.
>
>Thanks
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform