Visual Basic - Error 6 - Macros

Life is soft - evento anual de software empresarial
 
Vista:

Error 6 - Macros

Publicado por natu (1 intervención) el 06/09/2012 16:56:05
Hola tengo esta macro y no me deja guardar los documentos que combino masivamente:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Sub uno()
'
Dim i As Integer
    For i = 0 To ActiveDocument.MailMerge.DataSource.RecordCount
        With ActiveDocument.MailMerge
            .Destination = wdSendToNewDocument
            .SuppressBlankLines = True
            With .DataSource
                .FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
                .LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
            End With
            .Execute pause:=False
        End With
        Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
        Selection.Copy
        'MsgBox (Selection.Text + ".doc")'
        ChangeFileOpenDirectory "C:\Users\john.quiroga\Desktop\CARPETA COM"
        ActiveDocument.SaveAs FileName:=Selection.Text + ".doc", FileFormat:= _
            wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _
            :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
            :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
            SaveAsAOCELetter:=False
 
            'Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
                wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
                ManualDuplexPrint:=False, Collate:=True, Background:=False, PrintToFile:= _
                True, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
                PrintZoomPaperHeight:=0, outputfilename:=Selection.Text + ".tiff", Append:=False'
        ActiveDocument.Close
        'MsgBox ("")'
 
        ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
    Next
 
End Sub


Me sale error 6 y me subraya la linea 4 de la macro

Ayuda por favorrrrrr!!!!!!!!!!!!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder