[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

Lotus Notes email

I intend to send an email with an Excel attachment to some users. They will have to open it and fill it in with some infos. Is there a way that to have this email on completion(saved) to be sent to a specific email address.

Cheers
0
Bianchi928
Asked:
Bianchi928
  • 3
  • 3
1 Solution
 
techhealthCommented:
You can have a button for the user to click when they complete the form.  The code behind the button would be similar to this


Sub button1_click()

    ActiveWorkbook.SendMail _

    Recipients:="admin@company.com", _

    Subject:="Form completed: " & Format(Date, "dd/mmm/yy")

End Sub

Open in new window

0
 
Bianchi928Author Commented:
Looks simple..but do I have to create the button on each users or can I just have it as a VBScript instead which I can send together with the email.

Please advise
Thanks
Cheers
0
 
techhealthCommented:
No you actually create the button as part of the Excel file.  The code is what gets run after the user clicks the button.  This is called VBA (Visual Basic for Applications), which is intended to be embedded in your Microsoft Office files.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Bianchi928Author Commented:
As a test I have created an Excel file and have a button in there with your VBA code. But when I click the command button , nothing happens. I will like to remind you that I use Lotus Notes and my default email.
0
 
Sjef BosmanGroupware ConsultantCommented:
What does this have to do with VBScript?

I mean, why don't you create a Notes form with all the logic it needs and send that to those users?
0
 
techhealthCommented:
A few things I can think of:

1. Make sure you're out of the design mode - when you're in design mode with your Excel doc, clicking button doesn't run the code
2. Please don't just copy my sample code... for instance, if your button is called cmd1, the sub name needs to change accordingly.  If you put on the first command button on the worksheet and use the default name, here's the exact code
Private Sub CommandButton1_Click()
   ActiveWorkbook.SendMail Recipients:="admin@com.org", Subject:="Form completed: " & Format(Date, "dd/mmm/yy")
End Sub

Of course you need to put in your own email address there
3. Use the Control Toolbox to insert the button, not the Forms toolbar.  They look the same, but Forms only let you attach macro, not code

I tried the code with Notes as default email, and it correctly brought up the Notes' new message tab and had the file attached for emailing.  All I needed to do is to hit "Send" button.
0
 
Bianchi928Author Commented:
All good
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now