Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Migrating Outlook form (2003->2007) - Issue with Item_write

Posted on 2010-09-09
16
Medium Priority
?
1,017 Views
Last Modified: 2012-05-10
Hello,

A long time ago I wrote a small Outlook 2003 form. The goal of the form was quite simple: creating a custom appointment by presenting the user with two additional text fields, and, upon exiting, add the content of the fields to the subject. I am trying to use this form from within Outlok 2007 and it does not add anything to the subject.

I imported the form successfully, I can open it, I see my custom fields. I assume there is something wrong with the VB code used to modify the subject.

Any help or pointer would be appreciated.

 
Function Item_Write()

	intPos = Instr(Item.Subject,"[")
	
	if intPos > 0 Then
		strTemp = Left(Item.Subject, intPos-2)
		Item.Subject = strTemp & " [" & Item.UserProperties.Find("fldActe").Value & "] - " & Item.UserProperties.Find("Statut").Value

	Else
		Item.Subject = Item.Subject & " [" & Item.UserProperties.Find("fldActe").Value & "] - " & Item.UserProperties.Find("Statut").Value

	End If

End Function

Open in new window

0
Comment
Question by:xmi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 33680480
Hi, xmi.

I tested the code after eliminating the references to the user properties and it worked fine.  I recommend adding code to help you debug the problem.  For example, add something like

    MsgBox "IF path"
    MsgBox "Value of intPos: " & intPos
    MsgBox "Value of fldActe: " & Item.UserProperties.Find("fldActe").Value
    MsgBox "Value of Statut: " & Item.UserProperties.Find("Statut").Value

to both the IF and ELSE sides of the condition so you can see which path it's taking and test the values of the user properties.
0
 

Author Comment

by:xmi
ID: 33716993
Hi,

While I was about to test your suggestion, I realized that the code works fine when creating an appointment in the user's own calendar but not in the manager's shared calendar. This is something I did not see because the goal of the add-in is to streamline the way some appointments are taken by various people in the manager's calendar.

The manager also migrated from outlook 2003 to 2007. Should I have performed extra steps on his Outlook to make sure the addin work for all users ?

Thanks,

Xavier
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33730101
Xavier,

How is the code supposed to work with the manager's calendar? In other words, describe how the form should work on the manager's calendar.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:xmi
ID: 33732254
Hi,

The goal is to create some special appointment. This special appointment is a standard appointment with some extra information added to the subject: "my appointment subject" is transformed into "my special appointment subjet [abc] - [X]" where "abc" is a number entered via a text control box and "X" is a character entered via a drop down list control  box. (see images attached to this post).

The requested behavior is supposed to be the same for everyone: the manager, when a special appointment needs to be created, switch Outlook to his own calendar, goes to the Actions menu, selects "New Special Appointment", enters the usual information plus 'abc' and 'X'. Upon saving, the subject of the appointment is modified and saved to the manager calendar.

The manager has designated a few people as delegates for his calendar. These people must be able to create those special appointments into the manager calendar. So, they switch the Outlook view to the manager's calendar, go to the Actions menu, select "New Special Appointment", the usual information plus 'abc' and 'X'. Upon saving, the subject should be modified as outlined here above but nothing happens. Weird things: if a user tries to create a special appointment in his own calendard instead of the manager's calendar, the code behaves as expected.

This has been working fine for 6 years with Outlook 2003. I first thought of a code issue, but it looks more like a security or deployment issue with the "fdm" addin.

Thanks.
acte1.jpg
acte2.jpg
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33921089
Apologies for taking so long to respond.

So the process works fine for the local calendar, but not for the shared calendar.  Is this actually an add-in, or just a custom form?
0
 

Author Comment

by:xmi
ID: 33936989
It's a form (fdm file installed on each computer).

Thanks
0
 
LVL 76

Expert Comment

by:David Lee
ID: 33982586
Have you tried using an .oft instead?
0
 

Author Comment

by:xmi
ID: 34091544
Hi,

Sorry for the long delay. I haven't tried to use an oft. Maybe a stupid question but how can I convert the form from fdm to oft ? By editing it and saving it as an oft ?

Thanks,

Xavier
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34091637
Yes, by editing and saving.
0
 

Author Comment

by:xmi
ID: 34229125
I did a test and it does not seem to work. I will be onsite for a full day next week and will have some time to perform more tests. I'll post the results back.

Thanks for your help and patience.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34229970
You're welcome.  No problem.
0
 

Author Comment

by:xmi
ID: 34305932
No luck. Oft doesn't work. And what drives me crazy is that the fdm form works fine locally for each user, but when it comes to use it on the shared calendar, it doesn't...

I am convinced that the problem doesn't lie into the form, but somewhere in the security settings of the new Outlook 2007 (vs 2003) environment.

Thanks,
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 1000 total points
ID: 34307099
Is "Allow script in Public Folder" enabled in the "E-mail Security" section of the Trust Center?
0
 

Accepted Solution

by:
xmi earned 0 total points
ID: 34318612
Yes, but "allow scripts in shared folders" was not enabled. It did the trick !

Thanks,
0
 
LVL 76

Expert Comment

by:David Lee
ID: 34318664
You're welcome.
0
 

Author Closing Comment

by:xmi
ID: 34358747
Issue solved.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question