• Home
  • Blog
  • Resume
  • Contact
  • Projects
  • Gallery
  • Amit’s Resume
  • About Nagpur
KEEP IN TOUCH

Send File Path-Email via Groupwise

Jan30
2006
Leave a Comment Written by admin

This is what I had to do lots of times. Send the file path of an Excel workbook to my supervisor. So I created this macro to send the activeworkbook full file path to the specified user. This can actually be well modified to create an AddIn, but for now, this is what is going to be. Insert a module in the personal.xls and insert this code. A reference to “Groupware Type library” is a must to make this macro work.

Option Explicit
Private ogwApp As GroupwareTypeLibrary.Application
Private ogwRootAcct As GroupwareTypeLibrary.Account
Sub SendEmail()

Dim strRecipient As String
On Error GoTo SendEmail_Error
strRecipient = InputBox(“Enter the email address of recepient”, “Recipient Name”)
If strRecipient = “” Then
    MsgBox “No Recipient specified”, vbCritical
    Exit Sub
End If
Const NGW$ = “NGW”
Dim ogwNewMessage As GroupwareTypeLibrary.Mail
Dim StrSubject As String, StrBody As String
Dim strWkbkName As String, strWkbkPath As String
strWkbkName = ActiveWorkbook.Name
StrSubject = strWkbkName & “-File”
strWkbkPath = ActiveWorkbook.Path
StrBody = “Please find the file-” & strWkbkName & ” here- ” & strWkbkPath & “\” & strWkbkName
StrBody = StrBody & vbCrLf & vbCrLf & “Thanks”
If ogwApp Is Nothing Then ‘Need to set object reference
        DoEvents
        Set ogwApp = CreateObject(“NovellGroupWareSession”)
        DoEvents
End If
Dim StrLoginName As String, StrMailPassword As String
Set ogwRootAcct = ogwApp.Login
Set ogwNewMessage = ogwRootAcct.WorkFolder.Messages.Add(“GW.MESSAGE.MAIL”, egwDraft)
DoEvents
With ogwNewMessage
        .Recipients.Add (strRecipient)
         ‘Assign the SUBJECT text
        .Subject = StrSubject
         ‘Assign the BODY text
         .BodyText = StrBody
         ‘Send the message
        .Send
        DoEvents
End With
   On Error GoTo 0
   Set ogwRootAcct = Nothing
   Set ogwNewMessage = Nothing
   Set ogwApp = Nothing
   Exit Sub
SendEmail_Error:
    MsgBox “Error ” & Err.Number & ” (” & Err.Description & “) in procedure SendEmail”
    Set ogwRootAcct = Nothing
   Set ogwNewMessage = Nothing
   Set ogwApp = Nothing
End Sub

‘http://www.phhp.ufl.edu/~smanamal/misc/Groupwise.htm
‘http://www.vbaexpress.com/kb/getarticle.php?kb_id=277

Related posts:

  1. Change the creation date of a workbook
  2. Save HTML files from one folder to Excel files in another folder
Posted in Uncategorized - Tagged BODY, Groupware Type, MESSAGE, SUBJECT
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
« Auto increment a cell
» Trendline coefficients and regression analysis

No Comments Yet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Tags

Access Alt F8 Books boxplot cells charts count cursor dashboard data mining dbase design error excel excel functions export filter flip LaTex MS query Number Err ODBC pipes Press Alt F11 Public Sub python R random numbers Range Cells report scripting software sparklines SQL SQL server stack columns statistics stemming string tag cloud text mining UDF VBA visualization wildcard

Network

View Ashutosh Nandeshwar's profile on LinkedIn

Recent Comments

  • larry on Access Export to Excel (2007)
  • Betty Chou on Projects
  • Rwill on Access Export to Excel (2007)
  • Bharathi on The search key was not found in any record in Access
  • Michael on The search key was not found in any record in Access

Related Posts

  1. Change the creation date of a workbook
  2. Save HTML files from one folder to Excel files in another folder

EvoLve theme by Blogatize  •  Powered by WordPress nandeshwar.info