Jump to content

Convert VBA to Javascript


Recommended Posts

I am a complete novice, but I am hoping for some expertise. I am trying to convert my Microsoft access database to Caspio. I am stuck trying to initiate something like the following which i use successfully in access to auto send invoices and statements via email.

The vba code is below

Public Function EmailInv()
On Error Resume Next

DoCmd.OutputTo acOutputReport, "InvoiceCustomer", acFormatPDF, "G:\Shared drives\Office\Invoices\" & Forms!frmMain!JobNumber & ".pdf"
DoCmd.Close acReport, "InvoiceCustomer", acSaveNo


Dim OApp As Object, OMail As Object, signature As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.HTMLBody
With OMail
'.To = "someone@somedomain.com"
'.Subject = "Type your email subject here"
'.Attachments.Add
.To = Forms!frmMain.Form![Text245]
.Attachments.Add ("G:\Shared drives\Office\Invoices\" & Forms!frmMain!JobNumber & ".pdf")
.Subject = "Invoice from Perth Rewind Industries for " & Forms!frmMain!CustomerName & ""
.HTMLBody = "Please see the attached Invoice for Job " & Forms!frmMain!JobNumber & "" & vbNewLine & signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing
End Function

Can anyone help me in regards to this?

Link to comment
Share on other sites

Hello @Paul160,

As far as I know, when importing MS Access files to Caspio, it is possible to import only tables and relationships. 

Other functionality should be recreated using Caspio features. 

As for emails, there are 3 options to set them in Caspio:

1) On DataPages: the email is sent when the data is submitted or updated/deleted depending on the DataPage type.

You may want to review these articles:

https://howto.caspio.com/automatic-emails/automatic-email-types/

https://howto.caspio.com/automatic-emails/acknowledgement-and-notification-emails/

https://howto.caspio.com/automatic-emails/file-attachments-in-emails/

2) Using Triggered Actions: the email can be sent when the data is inserted/updated/deleted in the table https://howto.caspio.com/tables-and-views/triggered-actions/

3) Using Tasks: the email can be sent on-demand or based on a predefined schedule https://howto.caspio.com/tasks/

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...