Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Microsoft Word 2013 Create Form

Posted on 2013-11-10
5
Medium Priority
?
842 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 12

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 12

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 12

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 12

Accepted Solution

by:
Gregory Miller earned 1500 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

This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
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:
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

670 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