6 Replies Latest reply: Feb 18, 2015 11:23 AM by Daniel Garcia Mejia RSS

    Macro to paste Text Object in Word

    Daniel Garcia Mejia

      Hi to everyone,


      I'm trying to paste a Text Object (all object with style and font) to a Microsoft Word document. I tried a lof of things and search in community but I can't do it...

      My macro is:


      sub WordExport


              Set objWord = CreateObject("Word.Application")

              objWord.visible = false

              set objDoc=objWord.Documents.add

              Const wdOrientLandscape = 1

              objDoc.PageSetup.Orientation = wdOrientLandscape

              ActiveDocument.GetSheetObject("TX01").CopyTextToClipboard true

              ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true


              objDoc.SaveAs "C:\Daniel\Pruebas\PruebaMacro2"



      end sub


      So, I'm trying to copy objects TX01 and CH01 in word document. When I execute the macro, it doesn't work and doesn't show any error on screen...

      Can anybody help me?

      Thanks in advance!