Of cource (I'm not that blond ;-)) I picked the translated fields from the
Field List.
[Bedrijf] & Chr(13) & Chr(10) & "t.a.v. " & [Volledige naam] & Chr(13) &
Chr(10) & [Adres voor adressenlijst]
As I mentioned before, the formula works fine for a new contact. The fields
of the original form are exactly the same as on the new form, as the new form
is built from the old form.
I've slept on it one night and I understand that as the field is added and
so the formula is applied AFTER the form had been saved and calculated, the
fields remain empty. As soon as I perform an action on the form, the fields
are recalculated and the fields are filled in properly.
When I save, close and reopen the contact form - the values are still there,
but when I reopen Outlook, they are gone again and the field shows #FOUT
(#ERROR) again.
A new contact made with this form remains correct.
I hope this discussion isn't getting too boring as this same problem might
occure whenever you apply a changed form with a new calculated field to
exsiting Contacts folder members, so I think this matter deserves a solution.
I too experimented with the option to script the data collection. I tried
the following code (which doesn't work by the way):
Public WithEvents objPage As Outlook.Inspector
Public Sub Initialize_handler()
Set objPage = ModifiedFormPages("Adres")
End Sub
Private Sub objPage_Activate()
Set objControl = objPage.Controls("TextBox1")
objControl.Value = [CompanyName] & Chr(13) & Chr(10) & "t.a.v. " &
[FullName] & Chr(13) & Chr(10) & [MailingAddress]
End Sub
Instead, I made a workaround with a cmdButton and this code:
sub commandbutton1_click()
Set objPage = Item.GetInspector.ModifiedFormPages("Adres")
Set objControl = objPage.Controls("TextBox1")
objControl.Value = [CompanyName] & Chr(13) & Chr(10) & "t.a.v. " &
[FullName] & Chr(13) & Chr(10) & [MailingAddress]
end sub
This works fine, but doesn't still solves the previous problem.
*******************************
Sue Mosher said:
Since you have a Dutch version, did you pick the fields from the Field List to make sure you got the right names? (They may be localized for formula purposes.)
An ERROR# on first displaying the item could mean that one of the fields in the formula has never held any value.
The alternative to using a formula is to use a published form with code behind it to set the value of a text field. See
http://www.outlookcode.com/d/propsyntax.htm for syntax basics.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
I have a textfield with a formula like this in it:
[Company] & Chr(13) & Chr(10) & [Full Name] & Chr(13) & Chr(10) &
[Business Address]
The property of the field is set to "Auto calculate field" (or whatever this
is in English - I have a Dutch version) but it only recalculates after a
change to any field.
As I open an existing contact (with the new form) and I activate the tab
with the customized textbox (see post: Combining fields and new line), it
shows #ERROR and I have to change something in the form (anything), to get it
to recalculate and display the correct contents. After I save the form, the
correct contents remain.
Can I alter the field or form to avoid this?