Consulting

Results 1 to 4 of 4

Thread: Emailing Word Forms

  1. #1

    Emailing Word Forms

    I created a form in word. When the user has completed the form, I would like to have a button for them to click that would email the form to a predefined mailbox. If anyone can give me some help it would be appreciated.

    Ed

  2. #2
    I found a solution in the Word Forum.

    Thanks,
    Ed

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,478
    Location
    Hi Ed,
    Welcome to VBAX
    If you can post the solution or a link to it, that would be useful for anyone who finds themselves here!
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Cannot find the link, but here is the code I use.

    [VBA]
    Option Explicit
    Sub eMailActiveDocument()
    Dim OL AsObject
    Dim EmailItem AsObject
    Dim Doc As Document

    Application.ScreenUpdating = False
    Set OL = CreateObject("Outlook.Application")
    Set EmailItem = OL.CreateItem(olMailItem)
    Set Doc = ActiveDocument
    Doc.Save
    With EmailItem
    .Subject = "Insert Subject Here"
    .Body = "Insert message here" & vbCrLf & _
    "Line 2" & vbCrLf & _
    "Line 3"
    .To = "User@Domain.Com"
    .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
    .Attachments.Add Doc.FullName
    .Send
    End With

    Application.ScreenUpdating = True

    Set Doc = Nothing
    Set OL = Nothing
    Set EmailItem = Nothing

    End Sub
    [/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •