Knowledge Base

XCLN: How to Add Recipients to an EFD Project

Article ID: 164331

Article Last Modified on 10/28/2006


APPLIES TO


This article was previously published under Q164331

SUMMARY

This article shows you two methods to programmatically add a recipient to a Microsoft Electronic Forms Designer Form using Microsoft Visual Basic version 4.0 for 16 bit applications. One method uses OLE messaging and the other uses Msriched.vbx.

MORE INFORMATION

Method 1

This method uses OLE messaging.

NOTE: For the following code to function properly, at least one recipient must be placed on the To line (by using the Form user interface)
   Private Sub Command1_Click()
   'Call this sub routine from the Window_Store() function.
   'Towards the end of the function, just above the
   '"Window_Store = True" line of code

   Dim szRecip As String
   Dim objOneMsg As Object
   Dim objOneRecip As Object

   szRecip = "John Doe"
   Set objOneMsg = mfobj.message
   Set objOneRecip = objOneMsg.Recipients.Add
   objOneRecip.Name = szRecip
   objOneRecip.Type = 1    'MapiTo
   objOneRecip.Resolve

   objOneMsg.Update

   End Sub
				

Method 2

This method uses Msriched.vbx.
   Private Sub Command1_Click()
   Dim szRecip As String

   szRecip = "John Doe"
   ctlTo.Text(0) = szRecip
   ctlTo.TextBlocks = Len(szRecip)

   End Sub
				

Keywords: kbhowto kbprogramming KB164331