A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Saving as a Template means code doesn't work



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 19th 06, 06:58 AM posted to microsoft.public.outlook.program_forms
Michael Anderson
external usenet poster
 
Posts: 19
Default Saving as a Template means code doesn't work

I have customised an Outlook Contacts Form with the code...

Sub Item_CustomPropertyChange(ByVal Name)

If Name = "mxzMembershipStartDate" Then
dteDate = Item.UserProperties("mxzMembershipStartDate").Valu e
dteNextDate = DateAdd("m", 12, dteDate)
Item.UserProperties("mxzMembershipRenewalMonth").V alue = dteNextDate

If Item.UserProperties("mxzMembershipStartDate").Valu e = "" Then
dteNextDate = 12/12/2000
Item.UserProperties("mxzMembershipRenewalMonth").V alue = dteNextDate
End If
End If


End Sub

Sub mxzAddressButton_Click()

If Item.UserProperties("Other Address Street").Value = "" Then
Item.UserProperties("Other Address Street").Value =
Item.UserProperties("Business Address Street").Value
End If
If Item.UserProperties("mxzOtherSuburb").Value = "" Then
Item.UserProperties("mxzOtherSuburb").Value =
Item.UserProperties("mxzBusinessSuburb").Value
End If
If Item.UserProperties("Other Address City").Value = "" Then
Item.UserProperties("Other Address City").Value =
Item.UserProperties("Business Address City").Value
End If
If Item.UserProperties("Other Address Postal Code").Value = "" Then
Item.UserProperties("Other Address Postal Code").Value =
Item.UserProperties("Business Address Postal Code").Value
End If
End Sub

I want to give this to someone else. I saved this as a template. When I load
the Template my code does nothing. I guess copying the contents of the form
code to a text file and pasting it on an existing Contact form is one
alternative. I thought templates were better than that!


--
Thank You in Advance,

Michael Anderson
  #2  
Old January 19th 06, 05:22 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Saving as a Template means code doesn't work

Code hasn't run on template file forms for more than five years. They're not considered secure. If you want form code to run, give the .oft file to the other person and explain how they must publish the form.

--
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


"Michael Anderson" wrote in message ...
I have customised an Outlook Contacts Form with the code...

Sub Item_CustomPropertyChange(ByVal Name)

If Name = "mxzMembershipStartDate" Then
dteDate = Item.UserProperties("mxzMembershipStartDate").Valu e
dteNextDate = DateAdd("m", 12, dteDate)
Item.UserProperties("mxzMembershipRenewalMonth").V alue = dteNextDate

If Item.UserProperties("mxzMembershipStartDate").Valu e = "" Then
dteNextDate = 12/12/2000
Item.UserProperties("mxzMembershipRenewalMonth").V alue = dteNextDate
End If
End If


End Sub

Sub mxzAddressButton_Click()

If Item.UserProperties("Other Address Street").Value = "" Then
Item.UserProperties("Other Address Street").Value =
Item.UserProperties("Business Address Street").Value
End If
If Item.UserProperties("mxzOtherSuburb").Value = "" Then
Item.UserProperties("mxzOtherSuburb").Value =
Item.UserProperties("mxzBusinessSuburb").Value
End If
If Item.UserProperties("Other Address City").Value = "" Then
Item.UserProperties("Other Address City").Value =
Item.UserProperties("Business Address City").Value
End If
If Item.UserProperties("Other Address Postal Code").Value = "" Then
Item.UserProperties("Other Address Postal Code").Value =
Item.UserProperties("Business Address Postal Code").Value
End If
End Sub

I want to give this to someone else. I saved this as a template. When I load
the Template my code does nothing. I guess copying the contents of the form
code to a text file and pasting it on an existing Contact form is one
alternative. I thought templates were better than that!


--
Thank You in Advance,

Michael Anderson

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Contacts To CD Jim Outlook - Using Contacts 3 March 3rd 06 01:54 AM
Saving email 1970 Internet Inventor Outlook - Installation 1 February 21st 06 09:36 PM
OUTLOOK 2003: creating and saving an outlook template paradiseglass Outlook - General Queries 1 February 3rd 06 03:11 PM
saving pictures from e-mails Royalscotty Outlook - General Queries 3 January 31st 06 03:48 PM
Template John Smith Outlook - General Queries 0 January 20th 06 09:56 PM


All times are GMT +1. The time now is 03:37 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-2025 Outlook Banter.
The comments are property of their posters.