Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default form in excel to be attached to the emails address in the form upon sumission

hi

I have a form in excel, upon completion of the form, I need user to just
click on button, which will attached that form as excel to the email address
(to, cc & bcc) attached to that button. Thanks in advance for letting me know
what sort of macro can help.

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default form in excel to be attached to the emails address in the form upon sumission

Hi Abdulkader

See
http://www.rondebruin.nl/sendmail.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Abdulkader Bhanpurawala via OfficeKB.com" wrote in message ...
hi

I have a form in excel, upon completion of the form, I need user to just
click on button, which will attached that form as excel to the email address
(to, cc & bcc) attached to that button. Thanks in advance for letting me know
what sort of macro can help.

--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default form in excel to be attached to the emails address in the form upon sumission

Thanks dear, the website was very useful. I have a form now with three
different button attached with different macros, so the sender can select
anyone for submission of form. Now my demand increases, I would like to have
these button get activated only if they complete the form with the
information filled in the fields/cell which are mandatory. Thanks for support.


--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default form in excel to be attached to the emails address in the form upon sumission

hi Abdulkader

You can use this in your code to test if all the cells have a value

Sub test()
Dim myrange As Range
Set myrange = Worksheets("Sheet1").Range("A1:A6,C10,D12,G1:G3")
If Application.WorksheetFunction.CountA(myrange) < _
myrange.Cells.Count Then
MsgBox "fill in all cells"
Exit Sub
End If
MsgBox "Your code"
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Abdulkader Bhanpurawala via OfficeKB.com" wrote in message ...
Thanks dear, the website was very useful. I have a form now with three
different button attached with different macros, so the sender can select
anyone for submission of form. Now my demand increases, I would like to have
these button get activated only if they complete the form with the
information filled in the fields/cell which are mandatory. Thanks for support.


--
Message posted via http://www.officekb.com



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default form in excel to be attached to the emails address in the form upon sumission

Thanks dear. it is working!

--
Message posted via http://www.officekb.com


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default form in excel to be attached to the emails address in the form upon sumission

Abdulkader Bhanpurawala wrote:
Thanks dear. it is working!


hi! I need help again.

with microsoft outlook, it is working fine. Now, I have few user, who uses
Lotus notes as email application. The version used by them is 6.5.2. I wrote
below macro, but not working, can someone help to fix this as well. What I
need is form with a custome button "submit" & upon cliking it should check
whether all required field is filled in & send send mail to "To" & "CC" with
that form as an attachment. Thanks in advance.

Sub lotus()
'
' lotus Macro
' Macro recorded 7/6/2005 by Abdulkader
'

' Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim objNotesDocument As Object
Dim objNotesField As Object


'Function SendMail()

On Error GoTo SendMailError

EmailSendTo = "
EmailCCTo = "

'Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")

'Establish Connection to Mail File
' .GETDATABASE("SERVER","FILE")
Set objNotesMailFile = objNotesSession.GETDATABASE("", "")
'Open Mail
objNotesMailFile.OPENMAIL

'Create New Memo
Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT

'Create 'Subject' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject",
EmailSubject)

'Create 'Send To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EmailSendTo)

'Create 'Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EmailCCTo)

'Create 'Body' of memo
Set objNotesField = objNotesDocument.CREARERICHTEXTITEM("Body")

With objNotesField
.APPENDTEXT "Please find attached herewith the form duly filled in.
Looking forward toward receiving your quote. Thanks"
End With

'Attach the file --1454 indicate a file attachment
objNotesField = objNotesField.EMBEDOBJECT(1454, "", EmailSubject)
'objNotesField = objNotesField.EMBEDOBJECT(1454,"",ActiveWorkbook.F ullName)

'Send the e-mail
objNotesDocument.Send (0)

'Release storage
Set objNotesSession = Nothing
Set objNotesMailFile = Nothing
Set objNotesDocument = Nothing
Set objNotesField = Nothing

'Set return code
SendMail = True

'Exit Function

SendMailError:
Dim Msg
Msg = "Error#" & Str(Err.Number) & "was generated by" & Err.Source & Chr(13)
& Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

SendMail = False


End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200507/1
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default form in excel to be attached to the emails address in the form upon sumission

Sorry, don't know Lotus

Maybe you can use CDO for them ?
http://www.rondebruin.nl/cdo.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Abdulkader Bhanpurawala via OfficeKB.com" wrote in message ...
Abdulkader Bhanpurawala wrote:
Thanks dear. it is working!


hi! I need help again.

with microsoft outlook, it is working fine. Now, I have few user, who uses
Lotus notes as email application. The version used by them is 6.5.2. I wrote
below macro, but not working, can someone help to fix this as well. What I
need is form with a custome button "submit" & upon cliking it should check
whether all required field is filled in & send send mail to "To" & "CC" with
that form as an attachment. Thanks in advance.

Sub lotus()
'
' lotus Macro
' Macro recorded 7/6/2005 by Abdulkader
'

' Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim objNotesDocument As Object
Dim objNotesField As Object


'Function SendMail()

On Error GoTo SendMailError

EmailSendTo = "
EmailCCTo = "

'Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")

'Establish Connection to Mail File
' .GETDATABASE("SERVER","FILE")
Set objNotesMailFile = objNotesSession.GETDATABASE("", "")
'Open Mail
objNotesMailFile.OPENMAIL

'Create New Memo
Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT

'Create 'Subject' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject",
EmailSubject)

'Create 'Send To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EmailSendTo)

'Create 'Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EmailCCTo)

'Create 'Body' of memo
Set objNotesField = objNotesDocument.CREARERICHTEXTITEM("Body")

With objNotesField
.APPENDTEXT "Please find attached herewith the form duly filled in.
Looking forward toward receiving your quote. Thanks"
End With

'Attach the file --1454 indicate a file attachment
objNotesField = objNotesField.EMBEDOBJECT(1454, "", EmailSubject)
'objNotesField = objNotesField.EMBEDOBJECT(1454,"",ActiveWorkbook.F ullName)

'Send the e-mail
objNotesDocument.Send (0)

'Release storage
Set objNotesSession = Nothing
Set objNotesMailFile = Nothing
Set objNotesDocument = Nothing
Set objNotesField = Nothing

'Set return code
SendMail = True

'Exit Function

SendMailError:
Dim Msg
Msg = "Error#" & Str(Err.Number) & "was generated by" & Err.Source & Chr(13)
& Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

SendMail = False


End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200507/1



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro attached to command button - VBA form Roy Gudgeon[_2_] Excel Discussion (Misc queries) 2 March 16th 10 12:44 PM
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Can a form made in Excel 2002 be converted into a fillable form? Paraclete Excel Discussion (Misc queries) 1 February 20th 07 09:20 PM
Excel Form attached to a Word Document Letter Christine Excel Discussion (Misc queries) 0 December 12th 06 09:21 PM
Menu attached to a form? StefanW Excel Programming 3 October 6th 04 11:20 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"