Solved

Choose Profile Box with SendObject

Posted on 1998-04-30
1
260 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
1 Comment
 
LVL 17

Accepted Solution

by:
ramrom earned 50 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now