Solved

Microsoft Word 2013 Create Form

Posted on 2013-11-10
5
813 Views
Last Modified: 2013-11-14
What is the simplest method of creating a form in Microsoft Word 2013 that will save the current document, attach it to a new email window with the recipients and subject line already filled in?  The user then just writes a quick message and sends it.

I've been searching all over the Internet, but most answers are for older versions of Word.  I need this to work in Word 2013 and Word 2010.

Any help is greatly appreciated!
0
Comment
Question by:ggriffin1000
  • 4
5 Comments
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 39637550
Have you looked at InfoPath which does pretty much what you described but performs all the form and function within Outlook not Word. If this is not what you are wanting maybe a bit more detail on the process you are trying to achieve.
0
 

Author Comment

by:ggriffin1000
ID: 39637562
The following code works well in VBA:
    'Options.SendMailAttach = True
   ' ActiveDocument.SendMail

However, I also need to add recipients and a subject line when the new mail message window opens.

Also, to consider: on the MSDN website it states this code is for Exchange.  Clients are using Outlook as a POP/IMAP configuration and not Exchange.
0
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 39637568
So do you have a word document with a button on it to send the same document to an email recipient and you want to it as an attachment, which you have working, and you want to specify the TO: address and Subject line content? Is this right?
0
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 39637572
Sorry, one last question...
It the mail client the sender using always Outlook or is this an unknown?
0
 
LVL 11

Accepted Solution

by:
Gregory Miller earned 500 total points
ID: 39637598
Here is a nifty little script that works well with Outlook clients...
Found Here: http://www.gmayor.com/word_vba_examples.htm

Sub SendDocumentAsAttachment()
'This macro requires the Outlook Object library to be checked
'in the vba editor Tools > References
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then 'Document has not been saved
ActiveDocument.Save 'so save it
End If
'see if Outlook is running and if so turn your attention there
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook isn't running
'So fire it up
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Open a new e-mail message
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem 'and add the detail to it
.To = "someone@somewhere.com" 'send to this address
.Subject = "New subject" 'This is the message subject
.Body = "See attached document" ' This is the message body text
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue
.Display
'**********************************
'If you want to view the message before it goes
'change the line above from .Send to .Display
'Otherwise the message is sent straight to the Outbox
'and if you have Outlook set to send mail immediately,
'it will simply beSent
'with no obvious sign that Outlook has operated.
'Apart from the copy in the Outlook Sent folder
'**********************************
End With
If bStarted Then
'If the macro started Outlook, stop it again.
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

820 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