Tip

Add "FW:" to your mail forwarding

All mail clients have "FW:" when forwarding mails as a convention. Now notes has it too.

You can put this code in an action button with in your inbox folder and your Memo form.

 Sub Click(Source As Button) ? ? ? ?Dim session As New NotesSession ? ? ? ?Dim workspace As New NotesUIWorkspace ? ? ? ?Dim db As NotesDatabase ? ? ? ?Set db=session.currentdatabase ? ? ? ?Dim uidoc As NotesUIDocument ? ? ? ?Dim doc As NotesDocument, doc2 As NotesDocument ? ? ? ?Set uidoc = workspace.CurrentDocument ? ? ? ?If Not (uidoc Is Nothing) Then ? ? ? ? ? ? ? ?Set doc = uidoc.Document ? ? ? ?Else ? ? ? ? ? ? ? ?Set collection = db.UnprocessedDocuments ? ? ? ? ? ? ? ?For i = 1 To 1 ? ? ? ? ? ? ? ? ? ? ? ?Set doc = collection.GetNthDocument( i ) ? ? ? ? ? ? ? ?Next ? ? ? ?End If ? ? ? ?Const NotesMacro$ = "@Replacesubstring(sendto;'CN=':'/O=CST@CST';'':'')" ? 'replace CST with your Organization name. ? ? ? ?st = Evaluate(NotesMacro$, doc) ? ? ? ?Const NotesMacro2$ = "@Replacesubstring(copyto;'CN=':'/O=CST@CST';'':'')" ? ?'replace CST with your Organization name. ? ? ? ?Cc = Evaluate(NotesMacro2$, doc) ? ? ? ?Const NotesMacro3$ = "@Replacesubstring(from;'CN=':'/O=CST@CST':'/O=CST';'':'':'')" ? ?'replace CST with your Organization name. ? ? ? ?FR=Evaluate(NotesMacro3$, doc) ? ? ? ?Set itemA = doc.GetFirstItem( "Body" ) ? ? ? ?Set db = session.CurrentDatabase ? ? ? ?Set doc2 = New NotesDocument(db) ? ? ? ?Set st = New NotesItem( doc2, "st", st ) ? ? ? ?Set cc = New NotesItem( doc2, "cc", Cc ) ? ? ? ?doc2.Subject = "FW: "+ Cstr(doc.subject(0)) ? ? ? ?Set item2 = itemA.CopyItemToDocument( doc2, "Body2" ) ? ? ? ?Set item3 = New NotesRichTextItem( doc2 , "Body" ) ? ? ? ?Set richStyle = session.CreateRichTextStyle ? ? ? ?richStyle.FontSize = 8 ? ? ? ?richStyle.NotesColor = COLOR_DARK_MAGENTA ? ? ? ?Call item3.AppendStyle(richStyle) ? ? ? ?Call item3.AppendText( "----- Forwarded by "+session.commonusername+" on "+ Now+"-----" +Chr(10)+Chr(10) ) ? ? ? ?If doc.hasitem("copyto") And doc.hasitem("sendto") Then ? ? ? ? ? ? ? ?Call item3.AppendText("From: "+FR(0)+" On:"+Cstr(doc.PostedDate(0))+Chr(10)+"To: "+st.text+Chr(10)+"Cc: "+cc.text+Chr(10)+Chr(10)+"Subject: "+doc.subject(0)+Chr(10)+Chr(10)) ? ? ? ?Elseif doc.hasitem("sendto") Then ? ? ? ? ? ? ? ?Call item3.AppendText("From: "+FR(0)+" On:"+Cstr(doc.PostedDate(0))+Chr(10)+"To: "+st.text+Chr(10)+"Cc: "+Chr(10)+"Subject: "+Chr(10)+doc.subject(0)+Chr(10)+Chr(10)) ? ? ? ?Else ? ? ? ? ? ? ? ?Call item3.AppendText("From: "+FR(0)+" On:"+Cstr(doc.PostedDate(0))+Chr(10)+"To: "+Chr(10)+"Cc: "+Chr(10)+"Subject: "+Chr(10)+doc.subject(0)+Chr(10)+Chr(10)) ? ? ? ?End If ? ? ? ?Call item3.AppendRTItem( item2 ) ? ? ? ?richStyle.FontSize = 8 ? ? ? ?richStyle.NotesColor = COLOR_DARK_MAGENTA ? ? ? ?Call item3.AppendStyle(richStyle) ? ? ? ?Call item3.AppendText(Chr(10)+"___________________End Of Forwarded Msg_______________________________________________________________________ ;-)>" ) ? ? ? ?doc2.saveoptions="1" ? ? ? ?Call doc2.Save( False, True ) ? ? ? ?Set uidoc = workspace.EditDocument( True, doc2 ) ? ? ? ?flag = doc2.remove( True ) End Sub

This was first published in November 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.