Solved

Microsoft Word 2013 Create Form

Posted on 2013-11-10
5
796 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:Technodweeb
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:Technodweeb
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:Technodweeb
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:
Technodweeb 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:

744 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

16 Experts available now in Live!

Get 1:1 Help Now