Solved

Choose Profile Box with SendObject

Posted on 1998-04-30
1
300 Views
Last Modified: 2012-05-04
Is there a way to either eliminate the Choose Profile Box that comes up when you use SendObject or the send a keystroke (enterkey) ?
0
Comment
Question by:arcook
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 17

Accepted Solution

by:
ramrom earned 50 total points
ID: 1959097
Here is a sample VBA routine from a similar discussion back in March. (I as assuming you are using sendboject to mail; use this code instead:

Dim objSession As Object    
  Dim objMessage As Object
      Dim objRecipient As Object   
   Dim sProfile As String
      Dim sSubjPrmpt As String   
   Dim sTextPrmpt As String
      Dim sEmailPrmpt As String   
   Dim sMsgTitle As String
      ' Leaving sProfile equal to Null will
      ' force the user to select which Mapi
      ' profile to use. To keep from being
      ' prompted, you must supply a valid      
' user profile.
      sProfile = "" 
      sEmailPrmpt = "Enter valid Email Name of messagerecipient:"
      sSubjPrmpt = "Enter the subject line for this message:"
      sTextPrmpt = "Enter the text for this message:"
      sMsgTitle = "Mapi Macro Example"   
   ' Create the Session Object.
      Set objSession = CreateObject("mapi.session")
      ' Log on using the session object.
      ' Specify a valid profile name if you want to
      ' avoid the logon dialog box.      
objSession.Logon profileName:=sProfile
      ' Add a new message object to the OutBox.
      Set objMessage = objSession.Outbox.Messages.Add
      ' Set the properties of the message object.
      objMessage.Subject = InputBox(sSubjPrmpt, sMsgTitle)
      objMessage.Text = InputBox(sTextPrmpt, sMsgTitle)
      ' Add a recipient object to the objMessage.Recipients collection.
      Set objRecipient = objMessage.Recipients.Add
      ' Set the properties of the recipient object.
      objRecipient.Name = InputBox(sEmailPrmpt, sMsgTitle)
      objRecipient.Resolve
      ' Send the message. Setting showDialog to False
      ' sends the message without displaying the message
      ' or requiring user intervention. A setting of True
      ' displays the message and the user must choose
      ' to Send from within the message dialog.
      objMessage.Send showDialog:=False    
  MsgBox "Message sent successfully!"
      ' Log off using the session object.      
objSession.Logoff

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question