?
Solved

Choose Profile Box with SendObject

Posted on 1998-04-30
1
Medium Priority
?
313 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 150 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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