![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: dynamic, name, recipients, result |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a procedure that expects last name as a parameter; I am sending out
result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
| Ads |
|
#2
|
|||
|
|||
|
Could you be more specific with the help you need? Are there any particular
issues you're having with the Outlook Object Model? Your business logic is entirely up to you, but we can help for specific Outlook related stuff. BTW, running your Outlook code in a Scheduled Task is essentially a non-starter: The Outlook Object Model is unsuitable to run in a Windows service: http://support.microsoft.com/default...en-us%3b237913 -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I have a procedure that expects last name as a parameter; I am sending out result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
|
#3
|
|||
|
|||
|
I need to know...is it possible to know the user name (receipient name) from
outlook? I need to pass the receipient's name from the email that was received and in turn run the procedure that expects a username as a parameter. "Eric Legault [MVP - Outlook]" wrote: Could you be more specific with the help you need? Are there any particular issues you're having with the Outlook Object Model? Your business logic is entirely up to you, but we can help for specific Outlook related stuff. BTW, running your Outlook code in a Scheduled Task is essentially a non-starter: The Outlook Object Model is unsuitable to run in a Windows service: http://support.microsoft.com/default...en-us%3b237913 -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I have a procedure that expects last name as a parameter; I am sending out result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
|
#4
|
|||
|
|||
|
The MailItem.Recipients collection will tell you all that received the
e-mail, but not who the current user is. That requires the NameSpace.CurrentUser property, but accessing that value from an external program or script that's automating Outlook will generate a security warning. You can also use Win32 API calls to get the name of the user logged in to Windows: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"(ByVal lpBuffer As String, nSize As Long) As Long Function UserNameWindows() As String Dim lngLen As Long Dim strBuffer As String Const dhcMaxUserName = 255 strBuffer = Space(dhcMaxUserName) lngLen = dhcMaxUserName If CBool(GetUserName(strBuffer, lngLen)) Then UserNameWindows = Left$(strBuffer, lngLen - 1) Else UserNameWindows = "" End If End Function -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I need to know...is it possible to know the user name (receipient name) from outlook? I need to pass the receipient's name from the email that was received and in turn run the procedure that expects a username as a parameter. "Eric Legault [MVP - Outlook]" wrote: Could you be more specific with the help you need? Are there any particular issues you're having with the Outlook Object Model? Your business logic is entirely up to you, but we can help for specific Outlook related stuff. BTW, running your Outlook code in a Scheduled Task is essentially a non-starter: The Outlook Object Model is unsuitable to run in a Windows service: http://support.microsoft.com/default...en-us%3b237913 -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I have a procedure that expects last name as a parameter; I am sending out result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
|
#5
|
|||
|
|||
|
Thanks Eric. This I have already tried, this gives me the username of where
the application is running, I am running the application on my machine that sends out an email to multiple users, I need to know the user name of the receipient of the email, so that I can show the results for that user. Is this possible? "Eric Legault [MVP - Outlook]" wrote: The MailItem.Recipients collection will tell you all that received the e-mail, but not who the current user is. That requires the NameSpace.CurrentUser property, but accessing that value from an external program or script that's automating Outlook will generate a security warning. You can also use Win32 API calls to get the name of the user logged in to Windows: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"(ByVal lpBuffer As String, nSize As Long) As Long Function UserNameWindows() As String Dim lngLen As Long Dim strBuffer As String Const dhcMaxUserName = 255 strBuffer = Space(dhcMaxUserName) lngLen = dhcMaxUserName If CBool(GetUserName(strBuffer, lngLen)) Then UserNameWindows = Left$(strBuffer, lngLen - 1) Else UserNameWindows = "" End If End Function -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I need to know...is it possible to know the user name (receipient name) from outlook? I need to pass the receipient's name from the email that was received and in turn run the procedure that expects a username as a parameter. "Eric Legault [MVP - Outlook]" wrote: Could you be more specific with the help you need? Are there any particular issues you're having with the Outlook Object Model? Your business logic is entirely up to you, but we can help for specific Outlook related stuff. BTW, running your Outlook code in a Scheduled Task is essentially a non-starter: The Outlook Object Model is unsuitable to run in a Windows service: http://support.microsoft.com/default...en-us%3b237913 -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I have a procedure that expects last name as a parameter; I am sending out result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
|
#6
|
|||
|
|||
|
If you are sending the e-mail, wouldn't you already know the recipients you
are sending the e-mail to?? These users are stored as Recipient objects in the MailItem.Recipients collection. The Recipient.Name property tells you what the display name of the Recipient is. The MailItem.To property will also give you a delimited string containing the display names of the message recipients. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: Thanks Eric. This I have already tried, this gives me the username of where the application is running, I am running the application on my machine that sends out an email to multiple users, I need to know the user name of the receipient of the email, so that I can show the results for that user. Is this possible? "Eric Legault [MVP - Outlook]" wrote: The MailItem.Recipients collection will tell you all that received the e-mail, but not who the current user is. That requires the NameSpace.CurrentUser property, but accessing that value from an external program or script that's automating Outlook will generate a security warning. You can also use Win32 API calls to get the name of the user logged in to Windows: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"(ByVal lpBuffer As String, nSize As Long) As Long Function UserNameWindows() As String Dim lngLen As Long Dim strBuffer As String Const dhcMaxUserName = 255 strBuffer = Space(dhcMaxUserName) lngLen = dhcMaxUserName If CBool(GetUserName(strBuffer, lngLen)) Then UserNameWindows = Left$(strBuffer, lngLen - 1) Else UserNameWindows = "" End If End Function -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I need to know...is it possible to know the user name (receipient name) from outlook? I need to pass the receipient's name from the email that was received and in turn run the procedure that expects a username as a parameter. "Eric Legault [MVP - Outlook]" wrote: Could you be more specific with the help you need? Are there any particular issues you're having with the Outlook Object Model? Your business logic is entirely up to you, but we can help for specific Outlook related stuff. BTW, running your Outlook code in a Scheduled Task is essentially a non-starter: The Outlook Object Model is unsuitable to run in a Windows service: http://support.microsoft.com/default...en-us%3b237913 -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Pari" wrote: I have a procedure that expects last name as a parameter; I am sending out result of that procedure to multiple recipients, I would like to draft the email in such a way that data that I send to particular recipient shows ONLY his results. Example Table Structure ----------------------- Employee Last Name Open Calls A 10 B 5 C 0 Procedure that will return me result -------------------------------------------------- Givemeopencalls lastname EMPLOYEE A should receive an email stating “You have 10 Calls open” EMPLOYEE B should receive an email stating “You have 5 Calls open” EMPLOYEE C should receive an email stating “You have 0 Calls open” This whole process I am doing in VB6 and have that exe as a schedule task running from my machine every day. Please help |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Message could not be displayed in the search result | Dan | Outlook Express | 1 | February 10th 07 12:46 PM |
| Selecting contacts for new mail result in a ; in the To: No Name | Brian | Outlook - Using Contacts | 1 | November 9th 06 11:14 PM |
| Is a dynamic Map to location possible? | Angyl | Outlook - Using Forms | 0 | July 5th 06 07:00 PM |
| embedding dynamic data in signature file | don vito | Outlook and VBA | 3 | June 14th 06 07:12 AM |
| Outlook 2003 Dynamic signatures | TheHealingLotus | Outlook - General Queries | 1 | March 9th 06 01:38 PM |