Manage Learn to apply best practices and optimize your operations.

Internet Quoting For Email Reply

Here's an agent you can run while reading a mail document that will create
response document with each line of the original message preceded by a "> ", to
simulate a Unix email reply.

You can substitute your favorite ReplaceSubstring code, of course.
Sub Initialize
Dim workspace As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Dim newUiDoc As NotesUIDocument
Dim bodyText As String
Dim rtitem As Variant

Set uiDoc = workspace.CurrentDocument
bodyText = uiDoc.FieldGetText("Body")
Set newUiDoc = workspace.ComposeDocument("", "", "Reply With History")
newUiDoc.EditMode = True
newText = ReplaceSubString(bodyText, Chr(13) + Chr(10), Chr(13) + Chr(10)
+ "> ")
Call newUidoc.FieldSetText("Body", newText)
End Sub

Function ReplaceSubString(Byval inString As String, oldStr As String, newStr As
String) As String

Dim begin As Integer
Dim found As Integer
Dim replacementString As String
begin = 1

found = Instr(begin, inString, oldStr, 1)
While (found > 0)
begin = found + Len(newStr)
replacementString = Left$(inString, (found - 1)) & newStr & _
Right$(inString, Len(inString) - (found + (Len(oldStr) - 1)))
inString = replacementString
found = Instr(begin, inString, oldStr, 1)

ReplaceSubString = inString

Exit Function

End Function
This was last published in November 2000

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...