none
Error 6335 al intentar programar un Selection.Paste RRS feed

  • Pregunta

  • Grabo un macro en Word con Microsoft Visual Basic para aplicaciones, pero al reproducirlo me da siempre un error para el comando Selection.Paste y sus variedades (i.e. Selection.PasteAndFormat, etc.).

    El error que aparece, dice textualmente:

    "Se ha producido el error 6335 en tiempo de ejecución:

    La acción se bloqueó por una iniciativa de la organización. La acción se bloqueó por una iniciativa de la organización."

    Si lo corro paso por paso no aparece el error.

    Gracias

    martes, 7 de febrero de 2017 16:06

Todas las respuestas

  • I have a very similar problem: In a visual basic program (compiled to a dll file) I use a word.application object to do automatisation for word. The function in the dll is called from a word macro and essentially copies part of one document and pastes it into a newly created document (created opening a word template document).

    Paste ist done using .ActiveWindow.Selection.PasteAndFormat (wdFormatOriginalFormatting)

    This works fine up in many diffent installations up to latest word versions.

    It does not work though on one installation (windows 10, word 365): Macros do run in Word, method in dll is called, and copy commands throw no error. Coming to the PasteAndFormat command, an error is thrown (german version):

    Error 6335 in Microsoft Word: Die Aktion wurde durch eine Organisationsrichtlinie blockiert. (The action was blocked by organization policy)

    So there might be some very specific restriction for the use of macro commands, something like "no paste allowed", but where might I find such a restriction?

    lunes, 3 de abril de 2017 8:49
  • I have a very similar problem: In a visual basic program (compiled to a dll file) I use a word.application object to do automatisation for word. The function in the dll is called from a word macro and essentially copies part of one document and pastes it into a newly created document (created opening a word template document).

    Paste ist done using .ActiveWindow.Selection.PasteAndFormat (wdFormatOriginalFormatting)

    This works fine up in many diffent installations up to latest word versions.

    It does not work though on one installation (windows 10, word 365): Macros do run in Word, method in dll is called, and copy commands throw no error. Coming to the PasteAndFormat command, an error is thrown (german version):

    Error 6335 in Microsoft Word: Die Aktion wurde durch eine Organisationsrichtlinie blockiert. (The action was blocked by organization policy)

    So there might be some very specific restriction for the use of macro commands, something like "no paste allowed", but where might I find such a restriction?

    I just found out that the error does not occur any more. We did not change anything, just "waited".

    Today we tried the function again: it worked without throwing an error.

    viernes, 7 de abril de 2017 8:10