I have the code to create an excel macro to Lotus notes, but am having a problem. I would like to take some data from my workbook and feed it into Notes.
I have it so it looks through each row to find the data, and compiles it just fine, into another excel file. I think it needs to compile the data into a temp file and them post it somehow to MailDoc.Body, but my brain is failing me.
Here is my loop code. Any idea how to get it to gather the data and put it in MailDoc.Body rather than the excel file I created.
I am assuming instead of the DestFile I need to create some sort of DestCache and then pull it out of there somehow.
I hope this makes some sense[/code]
I have it so it looks through each row to find the data, and compiles it just fine, into another excel file. I think it needs to compile the data into a temp file and them post it somehow to MailDoc.Body, but my brain is failing me.
Here is my loop code. Any idea how to get it to gather the data and put it in MailDoc.Body rather than the excel file I created.
I am assuming instead of the DestFile I need to create some sort of DestCache and then pull it out of there somehow.
Code:
'
FileNum = FreeFile()
DestFile = "FILENAME"
On Error Resume Next
Open DestFile For Output As #FileNum
If Err <> 0 Then
MsgBox "Cannot open file "
End
End If
On Error GoTo 0
'OTHER CODE HERE
Loop for each row in selection.
For Each cell In Range("A1", Cells(65535, Range("a65536").End(xlToLeft).Column).End(xlUp))
' Write current cell's text to file with quotation marks.
'Add extra columns to this line with the & "," seperating them.
'Change value in zeropad() to match the cell width.
Print #FileNum, zeropad(cell.Offset(0, 0), 10) & "" & zeropad(cell.Offset(0, 1), 40) & "" & zeropad(cell.Offset(0, 2), 12) & "" & zeropad(cell.Offset(0, 3), 12)
Next cell
Close #FileNum
I hope this makes some sense[/code]