Discussion Locked

reference number of mail

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using ms outlook and ms outlook express, I want that there should be reference number on each mail which i send thru my outlook or outlook express.

in other words i want a serial number (autogenerated) for each of my mails sending outside.
please help on this issue

rupesh vaish

7 replies

by sparent

You'll have to create a VBA macro to do this! The trick will be where you wish to keep your last generated serial number.

One way would be to keep it in a hidden file.

Set Word = CreateObject("Word.Application")
Word.Visible = TRUE
Word.Documents.Open("C:\LastGenNo.doc")

Now I suppose you could actually store the number inside the file itself. But it might be easier if you simply create a user-defined property.

Word.UserProperties.Add("LastGeneratedNumber", olNumber)

You'd want to then increment the value everytime, you accessed the value, then return the new value

Word.UserProperties("LastGeneratedNumber").Value

I've given you most of the pieces of the puzzle to put this together. With a little bit of VBA coding you could put these together into a macro that can act as an incrementer.

There are other places you can store the number. One interesting one would be in the ContactItem object. That would allow you to create unique numbers but for the givenContact. Go into the VBA Editor (Alt+F11) and check out the object browser for ideas.

Good luck!
Steph

by shmaltz

Are you using Exchange?
Even if you don't use Exchange.
Most Email systems add somthing known as a messageID to every email which is always uniqu.
If you use Exchange you can check the Message ID by clicking options on a highlighted message in the sent items folder. I'm not sure if you use another email system with Outlook if it shows up in the Sent Items.

by sparent

I looked into Answer #2 before I put in my answer. The problem with the message id is that it is only assigned after it is sent! (The VBA property name for it is EntryID.)

I assumed you wanted to put that generated number in your message -- whether in the subject or the body!

Regards,
Steph

This discussion is closed to new replies.