Updating messages posted from custom forms?

  • Thread starter Thread starter Trent
  • Start date Start date
T

Trent

Hi All,
We have an Outlook form application that when the custom form submits it
sends a copy of itself rather than just the data and reference to the
original form. This had to be done because the form has a workflow to it
and we do not have the ability to publish to the Organizational Forms
Folder.

The code behind the form references a Word template file on one of our file
servers. That file server is being decommissioned and the folder has been
migrated to a new server with a different path. I have modified the blank
forms code to the new path but all of the previously submitted forms still
point to the old location.

Is it possible to loop through all of the messages in a specific folder and
do a search and replace on the path to the template file?
I have seen scripts that replace the documents message class but nothing
that looks inside the code to do a replace.

We have 2,550 submitted forms just from this year and it would help
tremendously if I could automate a way to replace those paths by supplying
folder location, string to search for and string to replace with.

TIA.
Trent
 
Oh, in case it matters.
We are using Exchange Server 2000.
Clients are using versions of Outlook between 2000 SP3 and Outlook 2003.
 
I think you're mixing up forms and items. The latter hold the data and are, presumably, the 2,550 submissions. Your description suggests that there is one and only one published form that all of these submissions use. If that is indeed the case, you only have to change the path in that one published form's code, increment the version number, and then republish.

For future reference, file paths are good things to put in custom properties, rather than hard-coding.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
No, in this case each message contains the form. They end up as one off
forms being posted to a different folder.
The forms are filled out from only the original location but then they
submit a copy of themselves with the entered data to another folder.
So all of the ones that have been sent previous to the update of the path
still have the old path within them.

I am unfamiliar with custom properties. These forms were developed 5 years
ago by someone who no longer works for the company, I just inherited the
support for them. In fact, I just transfered to a different position and no
longer technically support these but there is nobody else familiar with them
and they ran into trouble after the server folders were migrated so I am
just helping out.

Thanks.

I think you're mixing up forms and items. The latter hold the data and are,
presumably, the 2,550 submissions. Your description suggests that there is
one and only one published form that all of these submissions use. If that
is indeed the case, you only have to change the path in that one published
form's code, increment the version number, and then republish.

For future reference, file paths are good things to put in custom
properties, rather than hard-coding.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Then whether you update the path in the code in existing items is rather a moot issue, since one-off forms don't run code (at least not in any recent version of Outlook).
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
These do run code as we have used the security forms to allow them to run.
These forms have a workflow to them with several levels of involvement from
different groups around the company including HVAC, Security, Desktop
Support, etc. So it is important that the forms are able to continue
executing the code.
There is a tentative plan for replacing this system with an intranet
solution in the future but it could be as much as two years before it would
be in place.
In the meantime it would be tremendously useful to be able to update the
path to the template file in already published forms.
It does not prevent the forms from functioning otherwise, it is only a means
of printing a formatted version of the form but this can be very important
for the areas that need it as the forms have up to 5 tabs with different
information on each tab and doing screen prints of multiple pages gets
excessive.
I know there are other ways the forms can be rewritten to work better or if
company policy would allow us to publish in the Organizational Forms library
we would not have the one-off problems, the size of the messages would be
greatly reduced and form updates would be universal but none of these things
are possible at the moment. I am no longer on the team supporting these
forms and there is nobody familiar enough with them or Outlook form
programming to begin looking at repairs.
If I cannot provide a relatively simple fix for the current issue it will
remain unfixed. The impact will only last for a few months until the
non-updated messages have completed their tasks but it is a large burden for
many people during that time.

I do not want to sound argumentative, I was just asking if it was possible
to cycle through each posted message in a folder and search/replace the path
and if so, if I could find some sample code or information on how to
approach it. If it is possible it should be relatively easy to do.
I have searched quite a bit for information on this but have had no luck.
It may be that my unfamiliarity with the terms used is making my search less
productive.

Then whether you update the path in the code in existing items is rather a
moot issue, since one-off forms don't run code (at least not in any recent
version of Outlook).
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
FWIW, much of what we do here is try to uncover what the *real* issue. Quite often, people ask questions that don't reflect the real issue and don't provide sufficiently detailed information about their application environment. In your case, the fact that these are one-off forms that are allowed to run code is highly relevant, as well as highly unusual. It would have been nice to know that from the start. That would have made it easy to tell you right away that there is no fix for your scenario, since there is no way to programmatically change the code behind the forms that now embedded behind the items and since a solution involving a custom form (and removing the one-off state of the items) is not possible because publish to Org Forms.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I did say that in the original messageBut perhaps it was unclear. I did not say specifically that they were
one-off forms, just that they submit a copy of the form rather than just the
data and reference to the original form.

Using a hex editor I can find the path and modify it. If however the number
of bytes in the file changes the file will no longer open. I can change any
text I like as long as the length is the same. So I assume the file
contains some reference to it's own size that has to be modified as well.
I can make modifications and do file compares to locate where this value is
stored if I have to, or if someone can tell me where it is it would be
helpful. It obviously does not do a CRC check on itself since I can modify
existing information as long as the number of bytes remain the same so that
is not an issue.

If I can come up with code that will loop through every object in a
specified folder I may be able to make the path change and update the info
for the file byte length. I just do not know enough about Outlook and it's
object model to come up with that bit of code. My goal would be to write
something in VBA outside of Outlook to attach to the exchange server and
read these objects and attempt the modification. It really should not be a
long or complex bit of code once I know how to sequentially access the
objects in a given folder.


FWIW, much of what we do here is try to uncover what the *real* issue. Quite
often, people ask questions that don't reflect the real issue and don't
provide sufficiently detailed information about their application
environment. In your case, the fact that these are one-off forms that are
allowed to run code is highly relevant, as well as highly unusual. It would
have been nice to know that from the start. That would have made it easy to
tell you right away that there is no fix for your scenario, since there is
no way to programmatically change the code behind the forms that now
embedded behind the items and since a solution involving a custom form (and
removing the one-off state of the items) is not possible because publish to
Org Forms.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Looping through all the items in a folder is basic Outlook automation, covered in at least one KB article, as well as samples like http://www.outlookcode.com/d/convertfields.htm . Let us know if you get your project to work!

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I saved the original form as an oft file on my desktop then I modified the
one in Outlook to manually change the path to what it should be and then
saved that one as an oft file also.
I then did a comparison on the hex data in the files to find out where
changes occured.
The changes occured in a LOT of different locations but in a pretty
consistent manner.
If I understood the file structure of these files I would be able to predict
where and how changes would occur in the modified file and be able to script
something to calculate and make those changes on the fly. Primarily the
changes appear only to be a 4 byte unicode string that I presume is a
pointer within the file. When the file changes size due to the addition of
characters in the code then the pointer changes to reflect the newly shifted
position of things.

This is something I definitely could do, at least one file at a time,
probably automated but it might take more time than I have to devote to the
project since I no longer actually work for that area of the company.
Without access to information on the structure of the oft files it will take
much longer to piece together the why's of the differences between the files
so that I can predict the changes needed in each file.

I will tinker a bit more. I have to test and see if differences in the form
data cause changes that make predicting changes in the code data more
difficult. If not, it is not a difficult project but if it is, then coming
up with a method that works on the same form but with differing client data
will be a lot more difficult.

Thanks.

Looping through all the items in a folder is basic Outlook automation,
covered in at least one KB article, as well as samples like
http://www.outlookcode.com/d/convertfields.htm . Let us know if you get your
project to work!

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top