sending workbooks with Lotus Notes

That I don't do. What I've done is layered vba on vba (like I was saying earlier) so that I can enter 15 people in different cells, highlight the appropriate recipients and click the send button. They all end up with individual e-mails, with what ever attachments I've assigned to them in one batch send. It turned out to be the point of what I was doing.

There's got to be a way, but I don't have it off the top of my head and I have a big date.

Cheers,

Nate
This message was edited by NateO on 2002-02-20 18:24
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I should really just say create a group and put the group name in the field oh well thanks anyway
 
Upvote 0
Yeah,

That's one piece (of many) that I didn't mention. Lotus Notes nicknames work with this. If you have a group, it should work a name entry.

Cheers,

Nate
 
Upvote 0
Im having problems it only sends to one person and none of the cc or bccs
weird
doesn't send to all the people in the group only the first person.
 
Upvote 0
Ivan,

I've been using code similar to the example that you have given and found that if Notes is not open it can cause all sorts of problems with:

CreateObject("Notes.NotesSession") 'create notes session

Do you know of a way to check if Notes is running first and then proceed with the emial?

Thanks
AJW
 
Upvote 0
Hi AJW

Try using GetObject ... if it is not running it will return an Error. Just handle for this eg.....

Code:
    On Error Resume Next    ' Defer error trapping.
' Getobject function called without the first argument returns a 
' reference to an instance of the application. If the application isn't
' running, an error occurs.
    Set objNotes = Getobject("Notes.NotesSession")
    If Err.Number <> 0 Then NotesWasNotRunning = True
    Err.Clear    ' Clear Err object in case error occurred.
 
Upvote 0
Hi Ivan,

Thanks for the reply, I've been messing around with GetObject and error trapping all day to no avail.

Set objNotes = Getobject("Notes.NotesSession")
This gave an error when Notes was running and also when it wasn't running but the trapping did not seem to work.

Set objNotes = GetObject("", "Notes.NotesSession")
This worked for when Notes was running and allowed the rest of the code to run. It also tried to launch Notes when it was not running which is what I'm trying to avoid.

Here's my code todate:

Sub ConformationMail2()
On Error GoTo error:
Dim s As Object
Dim db As Object
Dim doc As Object

On Error Resume Next ' Defer error trapping.
' Getobject function called without the first argument returns a
' reference to an instance of the application. If the application isn't
' running, an error occurs.
Set s = GetObject("", "Notes.NotesSession")
If Err.Number <> 0 Then
NotesWasNotRunning = True
Err.Clear ' Clear Err object in case error occurred.

Else
Set db = s.GETDATABASE("", "")
Call db.OPENMAIL
mycell = Sheet1.Cells(1, 4)
Set doc = db.CREATEDOCUMENT
Msg = "WSM-Marketing Package has been installed. " & Date & " " & Time & Chr(10)
Call doc.REPLACEITEMVALUE("SendTo", "anton.water@whereever.com")
Call doc.REPLACEITEMVALUE("Subject", "WSM-Marketing User")
Call doc.REPLACEITEMVALUE("Body", Msg)
Call doc.Send(False)
Set s = Nothing
End If
error:
End Sub

What I'm trying to do is check if Notes is running before the email sends. If it tries to open Notes I get a scrambled database, it's especially a problem when your working offline as the code triggers when excel loads.

Any assistance would be appreciated.

Many Thanks

AJW
 
Upvote 0
Hi AJW

Sorry ... put you wrong .... PLEASE NOTE NOT TESTED!
I cannot test this as I don't use Notes ... only @ Work and I rearly program @ Work.

Code:
Sub ConformationMail2()
On Error GoTo error:
Dim s As Object
Dim db As Object
Dim doc As Object

On Error Resume Next
' Defer error trapping.
' Getobject function called without the first argument returns a
' reference to an instance of the application. If the application isn't
' running, an error occurs.
Set s = GetObject("", "Notes.NotesSession")
If Err.Number <> 0 Then
    MsgBox "Notes is Not Running"
    Err.Clear ' Clear Err object in case error occurred.
    Exit Sub
Else
    UserName = s.UserName
    MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
    Set db = s.GETDATABASE("", MailDbName)
    Call db.OPENMAIL
    mycell = Sheet1.Cells(1, 4)
    Set doc = db.CREATEDOCUMENT
    Msg = "WSM-Marketing Package has been installed. " & Date & " " & Time & Chr(10)
    Call doc.REPLACEITEMVALUE("SendTo", "anton.water@whereever.com")
    Call doc.REPLACEITEMVALUE("Subject", "WSM-Marketing User")
    Call doc.REPLACEITEMVALUE("Body", Msg)
    Call doc.Send(False)
    Set s = Nothing
End If


error:
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top