Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   Automatic Email From Custom Contact Form (http://www.outlookbanter.com/outlook-using-forms/29677-automatic-email-custom-contact-form.html)

Michelle W@ October 11th 06 04:54 PM

Automatic Email From Custom Contact Form
 
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?

Sue Mosher [MVP-Outlook] October 11th 06 05:27 PM

Automatic Email From Custom Contact Form
 
You could put code in the form's Item_Write event handler to generate such a message.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?


Michelle W@ October 11th 06 05:53 PM

Automatic Email From Custom Contact Form
 
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Sue Mosher [MVP-Outlook] October 11th 06 06:02 PM

Automatic Email From Custom Contact Form
 
The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Michelle W@ October 11th 06 07:08 PM

Automatic Email From Custom Contact Form
 
thanks so much!!!!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Michelle W@ October 11th 06 08:30 PM

Automatic Email From Custom Contact Form
 
Is there a way to put in the script so it only sends an email when the item
is created? Right now it is sending an email after any updating that is done
to the record... Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Michelle W@ October 11th 06 08:33 PM

Automatic Email From Custom Contact Form
 
Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?

"Michelle W@" wrote:

Is there a way to put in the script so it only sends an email when the item
is created? Right now it is sending an email after any updating that is done
to the record... Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Sue Mosher [MVP-Outlook] October 11th 06 09:27 PM

Automatic Email From Custom Contact Form
 
Is there a way to put in the script so it only sends an email when the item
is created?


Yes, but you're in danger of actually learning something about Outlook programming. Are you sure you want to do that? g

When a new item is created, it has a Size = 0. That means you can check the value of the Size property and act accordingly:

Function Item_Write()
If Item.Size = 0 Then
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End If
End Function

Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?


Yes, but it's time for you to do some homework of your own. All the pieces you need to do that are in the code above, except a couple that I'll give you. Here are the pieces you need to find and then put together to add your own code:

1) Outlook coding works largely with objects and properties of objects. There are many examples in the code above, where you read the property of one object and set the properties of another. Which object represents the current contact item?

2) Which object represents the new message to be sent?

3) Which property contains the name of the item? (HINT: It's the same for all types of items.)

4) Which property do you want to use to show the recipient the name of the new contact?

5) How do you put two pieces of text together?

I'll answer the last one for you -- with the ampersand & character, e.g. "red " & "balloon" would give you the string "red balloon."

See if you can figure it out, and then pat yourself on the back for learning something more than cut-and-paste about Outlook form scripting. Holler if you get stumped.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?

"Michelle W@" wrote:

Is there a way to put in the script so it only sends an email when the item
is created? Right now it is sending an email after any updating that is done
to the record... Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?



Michelle W@ October 11th 06 09:49 PM

Automatic Email From Custom Contact Form
 
Thanks so much Sue.... I am already learning more than I thought I would but
I really am loving it. I will challenge myself and see if I can figure out
the second half. Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

Is there a way to put in the script so it only sends an email when the item
is created?


Yes, but you're in danger of actually learning something about Outlook programming. Are you sure you want to do that? g

When a new item is created, it has a Size = 0. That means you can check the value of the Size property and act accordingly:

Function Item_Write()
If Item.Size = 0 Then
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End If
End Function

Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?


Yes, but it's time for you to do some homework of your own. All the pieces you need to do that are in the code above, except a couple that I'll give you. Here are the pieces you need to find and then put together to add your own code:

1) Outlook coding works largely with objects and properties of objects. There are many examples in the code above, where you read the property of one object and set the properties of another. Which object represents the current contact item?

2) Which object represents the new message to be sent?

3) Which property contains the name of the item? (HINT: It's the same for all types of items.)

4) Which property do you want to use to show the recipient the name of the new contact?

5) How do you put two pieces of text together?

I'll answer the last one for you -- with the ampersand & character, e.g. "red " & "balloon" would give you the string "red balloon."

See if you can figure it out, and then pat yourself on the back for learning something more than cut-and-paste about Outlook form scripting. Holler if you get stumped.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?

"Michelle W@" wrote:

Is there a way to put in the script so it only sends an email when the item
is created? Right now it is sending an email after any updating that is done
to the record... Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?




Michelle W@ October 16th 06 04:16 PM

Automatic Email From Custom Contact Form
 
Ok after banging my head and trying every possible combination I am looking
for a little more help.

Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?


Yes, but it's time for you to do some homework of your own. All the pieces you need to do that are in the code above, except a couple that I'll give you. Here are the pieces you need to find and then put together to add your own code:

1) Outlook coding works largely with objects and properties of objects. There are many examples in the code above, where you read the property of one object and set the properties of another. Which object represents the current contact item?

2) Which object represents the new message to be sent?

3) Which property contains the name of the item? (HINT: It's the same for all types of items.)

4) Which property do you want to use to show the recipient the name of the new contact?

5) How do you put two pieces of text together?

I'll answer the last one for you -- with the ampersand & character, e.g. "red " & "balloon" would give you the string "red balloon."

See if you can figure it out, and then pat yourself on the back for learning something more than cut-and-paste about Outlook form scripting. Holler if you get stumped.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
Also is there a way to program in the VB Script to note which contact the
addition is for within the email message so they know which one is new?

"Michelle W@" wrote:

Is there a way to put in the script so it only sends an email when the item
is created? Right now it is sending an email after any updating that is done
to the record... Thanks!

"Sue Mosher [MVP-Outlook]" wrote:

The basics would be:

Function Item_Write()
Set newItem = Application.CreateItem(0)
With newItem
.To = "
.Subject = "New contact"
.Body = "There is a new contact."
.Send
End With
End Function

Embellish to your heart's content.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Michelle W@" wrote in message ...
How do I go about doing that? Do you have a tutorial for it :)

"Sue Mosher [MVP-Outlook]" wrote:

You could put code in the form's Item_Write event handler to generate such a message.

"Michelle W@" wrote in message ...
I am building a custom contact form for my companies client database and what
I would like to have if possible is when the sales person initiates the
client contact form and saves it to a public folder an email would be
generated to me alerting me that a new contact has been filled out. Is this
possible?





All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com