Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button: ActiveX programming


Hello experts,

I have an excel table with 4 columns:
- Column 1 contains either nothing, "To", or "Cc" as email destination
fields
- Column 2 contains different email adresses
- Column 3 is empty and is named "To"
- Column 4 is empty and is named "Cc".

Under the first column "email destination field " (containing To, Cc or
no value), I want to add a button that will read through its totality
and then add the corresponding email adress to the "To" Column if a
"To" is read or to the "Cc" Column if a "Cc" is read, and of course do
nothing if nothing is mentionned.

I will then use the following macro to go through the "To" and "Cc"
Columns and create a blank email with the correct email adresses in the
"To" or "Cc"fields:
--------------------------------------------------------------------------
Sub SendWithAtt()

Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurrFile As String

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

ActiveWorkbook.Save

CurrFile = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name

With olMail
..To = strto
..CC = "
..Subject = "These two files"
..Body = ActiveSheet.Range("D4").Text & vbCrLf
..Attachments.Add CurrFile
..Attachments.Add "C:\Documents and Settings\THB3NI\My
Documents\Contact ist example.zip"
..Display '.Send
End With

Set olMail = Nothing
Set olApp = Nothing

End Sub

Private Function strto()



Dim cell As Range
'Dim strto As String
For Each cell In
ThisWorkbook.Sheets("tabelle1").Columns("I").Cells .SpecialCells(xlCellTypeConstants)
If cell.EntireRow.Hidden = False And cell.Value Like "*@*"
Then
strto = strto & cell.Value & ";"
End If
Next
strto = Left(strto, Len(strto) - 1)
--------------------------------------------------------------------------
Attached hereafter the Excel example of my problem

Thanks for your help

Nico


+-------------------------------------------------------------------+
|Filename: Contact Example.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4449 |
+-------------------------------------------------------------------+

--
nicolascap
------------------------------------------------------------------------
nicolascap's Profile: http://www.excelforum.com/member.php...o&userid=32044
View this thread: http://www.excelforum.com/showthread...hreadid=521718

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button: ActiveX programming


Anyone? please?


--
nicolascap
------------------------------------------------------------------------
nicolascap's Profile: http://www.excelforum.com/member.php...o&userid=32044
View this thread: http://www.excelforum.com/showthread...hreadid=521718

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
How do I run a macro with an activex button? geo Excel Discussion (Misc queries) 0 January 17th 06 10:55 PM
Activex control button problem pagelocator[_3_] Excel Programming 4 October 14th 05 03:06 PM
ActiveX button on sheet too big quartz[_2_] Excel Programming 6 June 28th 05 08:01 PM
ActiveX command button Dr.Schwartz Excel Programming 3 March 6th 05 06:41 AM
ActiveX Control Button Mark[_22_] Excel Programming 2 October 18th 03 05:16 PM


All times are GMT +1. The time now is 01:43 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"