PDA

View Full Version : Generating A Unique Digit



kbsudhir
02-05-2009, 08:41 AM
Hi All,

I want some guidance to write a code to generate 6Digit code as soon as I receive a mail in my outlook.

1. The code should be able to start generating the unique code from 000001 & going to alpha numeric once it reaches "999999"

2. Each new code should be a increment of 1 of the previous code.

Also I have another problem how to let the code know what was the previous code generated when I close my outlook & reopen it again.

:think: :think:

Any guidance regarding this is appreciated.

:help :help
Regards
Sudhir

JP2112
02-05-2009, 02:30 PM
Write a macro that writes a number to a text file on your hard drive whenever a new message is received. First, it would need to open the file, read the value, close the file, increase it by one, then recreate the file with the new value.

Check out the Application_NewMail or Items_ItemAdd Event, which fires every time a new message is received or a new item is added to a specific folder.

This code can be adapted for your purpose:
Event Code for Forwarding Selected Text to Another Email Address (http://www.codeforexcelandoutlook.com/blog/2008/04/event-code-for-forwarding-selected-text/)


HTH



Hi All,

I want some guidance to write a code to generate 6Digit code as soon as I receive a mail in my outlook.

1. The code should be able to start generating the unique code from 000001 & going to alpha numeric once it reaches "999999"

2. Each new code should be a increment of 1 of the previous code.

Also I have another problem how to let the code know what was the previous code generated when I close my outlook & reopen it again.

:think: :think:

Any guidance regarding this is appreciated.

:help :help
Regards
Sudhir

krismoore
12-03-2015, 02:09 PM
Hi,

Sorry I know this is an old thread but I was hoping someone could find the script mentioned above as the link is no longer active.

Many thanks

Kris

gmayor
12-03-2015, 11:02 PM
http://www.slipstick.com/developer/processing-incoming-e-mails-with-macros/ demonstrates how to process messages on arrival.