
Error .GOTOFIELD ("Body") al mandar email a lotus. AYUDA
Publicado por HLeal (2 intervenciones) el 24/06/2015 11:23:28
Hola podrian ayudarme, me estoy inciando en las macros y estoy en este momento creando una. Es una macro que manda emails desde VBA a lotus pero mis dos problemas son:
1 no se como ponerle texto entre cada imagen
2 me marca error en codigo . .GOTOFIELD ("Body") y algunas veces no lo marca, no entiendo que estoy haciendo mal.
Aqui mi codigo
Les agradezco su ayuda espero puedan ayudarme.
1 no se como ponerle texto entre cada imagen
2 me marca error en codigo . .GOTOFIELD ("Body") y algunas veces no lo marca, no entiendo que estoy haciendo mal.
Aqui mi codigo
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Sub lotus()
Dim NSession As Object
Dim NDatabase As Object
Dim NUIWorkSpace As Object
Dim NDoc As Object
Dim NUIdoc As Object
Dim WordApp As Object
Dim subject As String
Dim Recipient As Variant
Debug.Print subject
Set NSession = CreateObject("Notes.NotesSession")
Set NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set NDatabase = NSession.GETDATABASE("", "")
If Not NDatabase.IsOpen Then NDatabase.OPENMAIL
'Create a new Lotus Notes document
Set NDoc = NDatabase.CREATEDOCUMENT
Recipient = Array("hercy.lejeune@zodiacaerospace.com", "")
With NDoc
.sendto = Recipient 'CHANGE RECIPIENT EMAIL ADDRESS
.CopyTo = ("hercy.lejeune@zodiacaerospace.com")
.subject = "Revues De Commandes à Compléter et Signer" & Chr(10) & Now
'Email body text, including marker text which will be replaced by the Excel cells
.body = "Merci d'avance pour vos actions"
.Save True, False
End With
'Edit the just-created document to copy and paste the Excel cells into it via Word
Set NUIdoc = NUIWorkSpace.EDITDocument(True, NDoc)
With NUIdoc
'Find the marker text in the Body item
.GOTOFIELD ("Body")
'.FINDSTRING "A3:F16"
'.DESELECTALL 'Uncomment to leave the marker text in place (cells are inserted immediately before)
'Copy Excel cells to clipboard
Sheets("àsigner").Range("A3:F15").Copy
'Create a temporary Word Document
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = False 'True to aid debugging
WordApp.Documents.Add
'Paste into Word document and copy to clipboard
With WordApp.Selection
.PasteSpecial DataType:=10 'Enum WdPasteDataType: 10 = HTML; 2 = Text; 1 = RTF
.WholeStory
.Copy
End With
.Paste
'Paste from clipboard (Word) to Lotus Notes document
Application.CutCopyMode = False
Sheets("Missing pos").Range("A2:B39").Copy
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = False
WordApp.Documents.Add
With WordApp.Selection
.PasteSpecial DataType:=10 'Enum WdPasteDataType: 10 = HTML; 2 = Text; 1 = RTF
.WholeStory
.Copy
End With
.Paste
WordApp.Quit SaveChanges:=False
Set WordApp = Nothing
.SEND (False)
.Close
End With
Set NSession = Nothing
End Sub
Les agradezco su ayuda espero puedan ayudarme.
Valora esta pregunta


0