Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-07-2011, 09:24 AM
sbt sbt is offline
Beginner Member
 
Posts: 1
Default Use Excel VB code to Send Attachment from Zimbra Desktop

Excel 2007
Windows XP
Zimbra Desktop 1.0.4 (build 1833)

I would like to send a pdf file from my Excel VBA code through Zimbra desktop. The cells that I reference in my code have the proper paths and file names required to provide an email, subject and attachment.

I have uploaded a text file to my post, which shows how I am already allowing a user who has outlook to send a pdf. But when I tried to do the same thing using a shell command, zimbra desktop pops up, but it has not opened a new message, and it has not attached the pdf.


Unfortunately, I am unfamiliar with enough of the zimbra commands to pass an email, subject or attachment correctly .

I found this Reference case, but it does not quite show me all of the commands/steps I need.
'http://www.zimbra.com/forums/developers/37439-trying-create-zimbra-desktop-mapi-dll.html


My Code so far
-----------------------------------

Private Sub SendZimbra_Click()
Dim SH As Worksheet, TP As Worksheet
Set TP = Sheets("Template")
Set SH = Sheets("Purchased Items")




EmailAnswer = MsgBox("Create Email Now ?", vbYesNo)

If EmailAnswer = 6 Then
'Start Email Creation Process. 6 = Yes, 7 = No



Dim directory As String
Dim ZimbraPath As String, activedocument As Workbook

ZimbraPath = SH.Cells(1, 21)
directory = SH.Cells(3, 3)
AttachementName = SH.Cells(3, 3) & SH.Cells(2, 3) & " Packing Slip.pdf" 'Attachment Name & Location
SubjectName = SH.Cells(4, 3) 'Cell C4 has the subject name
EmailTo = SH.Cells(5, 3)



If AttachementName <> "" Then
On Error GoTo 1
Shell (ZimbraPath & " -sendfile " & AttachementName)
End If



err_handler:
1
'MsgBox "PDF File does not exist !" & vbCrLf & "Create PDF, then Try Again." & vbCrLf & vbCrLf & "File Name : " & AttachementName
'Resume Next 'Ignors the error
If Err.Description <> "" Then MsgBox Err.Description

' End 'End the email creation




End If 'End creating email

End Sub

Last edited by phoenix; 01-07-2011 at 10:21 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.