E-mail a word form with subject & cc

I have a Microsoft Word form in a template and I created a button so they can submit the form via e-mail when they are done filling it out, but I'm not sure how to automatically populate the CC: Field and the Subject: Field of the e-mail.

I'm using this code which opens up an e-mail message with the document as an attachment.  How can I add text for the CC's and the subject?:

Private Sub CommandButton1_Click()
Options.SendMailAttach = True
End Sub
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

levrConnect With a Mentor Commented:
' create a session object and open session
    Set oSess = GetObject(, "mapi.Session")
    If oSess Is Nothing Then Set oSess = GetObject("", "mapi.Session")
    oSess.Logon profileName:="email_userid"

' then you can manipulate with the message before sending
Set oMess = oSess.Outbox.Messages.Add
        Set oRec = oMess.Recipients.Add
        oRec.Name ="email_address"
        oMess.Subject ="subject"
        oMess.Text = strTemp
        oMess.DeliveryReceipt = False
        oMess.Send SaveCopy:=False, ShowDialog:=False

Good Luck,
nare dont bother with that link

try this matey

this will show how to user the other fields you want to complete

Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Const SW_SHOW = 5

Public Function OpenEmail(ByVal EmailAddress As String, _
    Optional Subject As String, Optional Body As String) _
    As Boolean

    Dim lWindow As Long
    Dim lRet As Long
    Dim sParams As String
    sParams = EmailAddress
    If LCase(Left(sParams, 7)) <> "mailto:" Then _
        sParams = "mailto:" & sParams
 If Subject <> "" Then sParams = sParams & "?subject=" & Subject
    If Body <> "" Then
        sParams = sParams & IIf(Subject = "", "?", "&")
        sParams = sParams & "body=" & Body
    End If

   lRet = ShellExecute(lWindow, "open", sParams, _
    vbNullString, vbNullString, SW_SHOW)
   OpenEmail = lRet = 0

End Function


The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

thocuttAuthor Commented:
Isn't there an easier way to do this like

Private Sub CommandButton1_Click()
Options.SendMailAttach = True
ActiveDocument.SendMail(,"thocutt@yahoo.com","Travel Arrangements", , )
End Sub

I always want the subject and CC to be the same.  Does is have to be a boatload of code, or can it be simple like above?
thocuttAuthor Commented:
Hmmm, let me try this out.
Hi thocutt,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: Maxim10553 and levr@devx

thocutt, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

CS Moderator

Maxim10553: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328654
All Courses

From novice to tech pro — start learning today.