Current location - Quotes Website - Signature design - How to display the date in the signature in OUTLOOK6?
How to display the date in the signature in OUTLOOK6?
The signature is generated by the script, and the second one is not the signature that comes with outlook.

Outlook supports signature, but the date is added to the signature by using Word field, so when you create an email, you can't automatically update it to the current system date, and you have to press F9 to update it, which is very inconvenient, because I wrote a script with VBA to automatically add the signature content to meet the needs of users, and the date can automatically extract the current date.

note:

Outlook macro security must be set to low.

If anyone is interested, you can operate in the following ways:

1. Open outlook and cancel the original signature.

2. Display menu (Tools-Macro-Visual Basic Editor)

3. In the editor that appears, select ThisOutlookSession from the left, and the right should be blank by default.

4. Copy the following code to the right:

-

Dim myOlApp as a new prospect. app; application

Privatewithevents myospectors as Outlook. inspector

As a private myMailItem for Outlook. Mail item

Function signature in string form ()

Mark a date as a date

MDate = format (now "yyyy-MM-dd")

Signature = " & ltfont size=2 >

Signature = signature & amp“& ltp>? & lt/p >;

Signature = signature & "& ltpstyle =" "font-size:10px" ""> & amp "& ltbr/>

Signature = signature & "Salute! & lt/p >;

Signature = signature & "& ltpstyle =" "font-size:10px" ""> Shang Deming

Signature = signature & "/-<; br />

Signature = signature & "? Germany beifu automation co., ltd. Shanghai representative office

Signature = signature & "A supplement. :? 5/F, No.0/63, Shibei Industrial Park, Jiangchang 3rd Road, Shanghai (200436? )& ltbr />

Signature = signature & "Phone:? 02 1-663 12666-837; br />

Signature = signature & "Fax:? 02 1-663 15696 & lt; br />

Signature = Signature & "Mail:? & lta href = " " " mailto:d . Shang @ beckhoff . com . cn " " " " & gt; d.shang@beckhoff.com.cn & lt/a & gt; & ltbr />

Signature = signature & amp" Web:? & lta href = " " " "/" " " & gt; www.beckhoff.com.cn & lt/a & gt; & ltbr />

Signature = signature & "? & lta href = " " " "/" " " & gt; www.pc-control.net & lt/a & gt; & ltbr />

Signature = signature & "? & lta href = " " " http://www . ether cat . org/" " " " & gt; www.ethercat.org & lt/a & gt; ? & lt/p >;

Signature = signature & "< span & gt/-< /span >;

Signature = signature & amp“& lt/font >

End function

Private sub-application _Startup ()

Get a signature

Set myOlInspectors = myOlApp. inspector

End joint

private Sub myOlInspectors _ new Inspector(ByVal Inspector As Inspector)

Set myMailItem = Inspector. Current project

Use myMailItem

. HTMLBody = Signature()

If it is outlook 2007, please comment out this line.

End with ...

End joint

-

The middle part is the signed HTML content, which can be modified according to your own needs.

5. Save and exit. Restart outlook and set it to low in Tools-Macros-Security.

In the future, new messages will use the signature content set in the code.