Если вам нужно отправить сообщение электронной почты из документа Word через Outlook, а также прикрепить текущий файл Word, вы можете создать командную кнопку, а затем отправить сообщение, нажав эту кнопку, не открывая Outlook. В этой статье я расскажу, как быстро и легко с этим справиться.
Применить кнопку для отправки электронного письма с прикрепленным текущим файлом Word
Применить кнопку для отправки электронного письма с прикрепленным текущим файлом Word
Для решения этой задачи в файле Word выполните следующие действия:
1. Сначала вы должны создать командную кнопку, пожалуйста, нажмите Застройщик > Устаревшие инструменты > Командная кнопка (элемент управления ActiveX), см. снимок экрана:
2. Выберите кнопку и щелкните Предложения под Застройщик в Предложения панели введите нужный текст подписи в Подпись поле, см. снимок экрана:
3. Затем закройте Предложения панель, теперь щелкните кнопку правой кнопкой мыши и выберите Просмотреть код, см. снимок экрана:
4. А затем в отображаемом Microsoft Visual Basic для приложений окна, скопируйте и вставьте приведенный ниже код между исходными сценариями, см. снимок экрана:
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.Save
With xEmail
.Subject = "Fax-data"
.Body = "This is a test email."
.To = "yy@addin99.com"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
Внимание: В приведенном выше коде вы должны изменить тему, основной текст или адрес отправления по своему усмотрению.
5. Затем сохраните и закройте этот код, нажмите Режим проектирования чтобы выключить режим дизайна. Теперь при нажатии созданной вами командной кнопки будет создано электронное письмо с текущим документом Word в качестве вложения, см. Снимок экрана:
6. Наконец, вам просто нужно нажать Отправить кнопку, чтобы отправить это сообщение.
Рекомендуемые инструменты для повышения производительности Word
Kutools For Word — Более 100 расширенных функций для Word, сэкономьте 50% времени
- Сложные и повторяющиеся операции можно производить разово за секунды.
- Вставляйте сразу несколько изображений из папок в документ Word.
- Объединяйте и объединяйте несколько файлов Word из папок в одну в желаемом порядке.
- Разделите текущий документ на отдельные документы в соответствии с заголовком, разрывом раздела или другими критериями.
- Преобразование файлов между Doc и Docx, Docx и PDF, набор инструментов для общих преобразований и выбора и т. Д.
Комментарии (29)
Оценок пока нет. Оцените первым!
- Remove From My Forums
-
Question
-
Hi guys!
Is there anybody here who knows how to add a button in a Microsoft Word document? Then when I click the button it sends an email with the document as attachment.Thanks.
Answers
-
In the object model HELP files, look up the MailEnvelope object, with related topics. Note that this is an extension of *Outlook*. Any further questions on this topic you should pursue in an Outlook or Word programming group (or possibly a combination of the two).
All replies
-
Looks interesting! will give it a try and let you know.
Regards
Pavan -
This is actually very cool Kathleen! I mean if i had to do this without using VSTO appraoch i had to take care of a zillion things.
But i wonder why VSTO doesnt support Office 2k,XP and 12. Are there any plans for the same?
-
I’ve got it working this way using the .sendmail() method but can anyone tell me how to get the email system built into word 2003 working so that it sends the document as the email and not an attachment?
like>
http://www.boomspeed.com/dead_smed/doc10.jpeg
Many thanks for any help
-
Copied from the object model help for the sendmail() method:
Opens a message window for sending the specified document through Microsoft Exchange.
Note Use the SendMailAttach property to control whether the document is sent as text in the message window or as an attachment.
expression.SendMail
expression Required. An expression that returns a Document object.
Example
This example sends the active document as an attachment to a mail message.
Options.SendMailAttach = True ActiveDocument.SendMail
-
that does use the document as the body instead of an attachment but looses the formatting and doesn’t use the email options that are built into Word, is it possible to use it like in the screenshot supplied?
-
In the object model HELP files, look up the MailEnvelope object, with related topics. Note that this is an extension of *Outlook*. Any further questions on this topic you should pursue in an Outlook or Word programming group (or possibly a combination of the two).
-
this.ActiveWindow.EnvelopeVisible = true;
seems to have cracked it, many thanks!
-
Is there a way to also set the MailTo: property, and subject using this method.
I am able to attach word doc but can’t get it to address the email for me.
I don’t want to have to use the mailmerge property as there is no datasource.
The document I am trying to email is a form template in word sent to same address everytime.
Assalamu Walaikum,
In this video, I will show you, how to Create Submit or Email Button in Microsoft Word. Firstly, Go to the Developer tool. If you do have no developer tool in the menu list. You have to go to «file menu» and option, custom ribbon, and checkmark the developer tool and Select the Design Mode. click legacy tool, Select the button. Type the Button name. Double Click one button. Type code:
Private Sub btnSubmit_Click()
Options.SendMailAttach = True
ActiveDocument.SendMail
End Sub
Click the save.
Thanks
- Tweet
- Share
- Share
- Share
- Share
Sign up here with your email
В 2013 офисе кнопку «Отправить файл» обнаружить оказалось не просто. Ее неплохо замаскировали. Озадачившись ее поиском, обнаружил 2 способа до нее добраться. Вариант 1 – через меню «Файл».Нужно нажать «Файл» / «Общий доступ» / «Отправить по электронной почте» (Рис.1).
Рис.1. Отправить документ Word по почте
Тут уже интересно, ибо файл можно отправить в 2 форматах – просто как файл Word или в формате PDF. Конечно, можно использовать и XPS, но этот формат не получил распространения, потому сомневаюсь, что вы его будете использовать. Хотя, кто знает – может и пригодится в хозяйстве.
2-й вариант – вывести кнопку «Отправить по электронной почте» в панель быстрого доступа. Кнопка настройки панели быстрого доступа расположена в верхней левой части экрана (Рис.2). Нажмите левой кнопкой мыши для вызова меню и выберите пункт «Отправить по электронной почте».
Рис.2. Кнопка настройки панели быстрого доступа
В результате в верху Word появится кнопка конверта со скрепкой (Рис.3).
Рис.3. Кнопка «Отправить по электронной почте»
Описанное выше сработает, если в вашем Windows настроена почтовая программа, которую надо открывать при попытке отправить сообщения. О том, как выбрать почтовый клиент по умолчанию в Windows, читайте на странице http://markimarta.ru/windowsos/kak-vybrat-pochtovyj-klient-po-umolchaniyu-v-windows.html
No comments yet.
01-05-2012, 07:43 AM |
|||
|
|||
Adding email button to Word form
I need to create a button at the end of a MS Word Form that emails the document as an attachment. I’m having trouble figuring out how to do this. Any help would be appreciated. Windows XP |
01-05-2012, 06:25 PM |
Hi leilers, Beyond adding ‘ActiveDocument.SendMail’ to your form, what issues are you having?
__________________ |
01-06-2012, 05:20 AM |
|||
|
|||
Quote:
Originally Posted by macropod Hi leilers, Beyond adding ‘ActiveDocument.SendMail’ to your form, what issues are you having? I admit to not even knowing what ‘ActiveDocument.SendMail’ is. I have a form with several questions and text boxes for answers. I would like to be able to create some sort of button at the bottom of the page that when clicked would automatically send the filled out form document to an email address. I’m sure there must be some way to do it via the Developer tab, but I’m not very Visual Basic savvy. |
01-06-2012, 07:36 PM |
Hi leilers, In Word, userforms are a particular kind of form that typically looks vaguely like a Word dialogue box. Since you posted in ‘UserForms’, I understood that to be what you have, in which case, you’d also have known how to use the vba (macro) statement ‘ActiveDocument.SendMail’ . So perhaps we’d better start from first principles: What kind of form are you using? For example a document with formfields, a document with content controls, a document with a userform, a document with ActiveX controls. Whatever kind of document is is, you’ll need some vba (macro) code to automate the emailing. Aside from the basic ‘ActiveDocument.SendMail’ line I suggested, a fully-fledged macro might look something like the one here:
__________________ |
01-09-2012, 06:45 AM |
|||
|
|||
What I have is a Word 2010 document that I’ve added some form style sections to, via the Developer Tab. So, no, I don’t think I’m actually using a userform and thus am in the wrong forum. I’ve found some macro code that I think will do the trick (and thank you for the link!), but I’m unsure how to add it in to the Word document that I’m working with. On the Developer Tab I see the Visual Basic and Macro buttons, but I’m unclear on how to get the code added in properly. If this is too noobish for this forum, just point me to the right place and I’ll cease bothering you. Regardless, thank you for all your help! |
01-09-2012, 03:21 PM |
Hi leilers, It’s not a question of being ‘noobish’, but of trying to establish exactly what the issue is that you’re seeking help with. If you can post a copy of your document and the code you’re proposing to use, I’ll see what needs to be done to get them working together. FWIW, the general procedure for adding vba code to a document is outlined here: http://www.gmayor.com/installing_macro.htm PS: I’ve moved the thread to the more general ‘Word’ forum.
__________________ |
It is no secret that visuals and symbols are the most effective tools for making your text interactive. Word has supplied several such interactive symbols for the same. Let us get right into a detailed guide to add the mail/envelope symbol in Word in simple steps.
Helping you save time, here is a thorough step-by-step guide to three simple ways to insert the mail/ envelope symbol (✉) to your word document. Windows allows several ways to insert any symbol into your text. These include using shortcuts with Alt Code, copy-pasting the desired symbol, or using the symbol dialog.
- Using Shortcuts with Alt Code
Windows has supplied specific shortcut codes or Alt Codes for all the symbols inserted in a word text. The Alt Code for the mail/envelope symbol is 9993. To use this Alt Code to insert the envelope symbol, follow the steps below:
- Press the num lock key enabling the numeric keypad. On laptops, press the Fn key + NumLk key to enabling the numeric keypad.
- Press down on the Alt key and, using the numeric keyboard type the desired Alt code, in this case, 9993.
- Release the Alt key after you have typed the code.
The envelope symbol ✉ should be visible now.
Note: If you are using a tablet with a detachable keyboard like a Windows Surface, then you just need to press the Fn key to enable the numeric keypad.
- Using the Copy-Paste Method
A quite simple way to get any desired symbol to your word text is by using the copy-paste method. You can do this by following the steps below:
- Take your cursor to the mail/envelope symbol here: ✉
- Press down the right side of your mouse to select the symbol, or press down the shift key on your keyboard and press the right arrow key to select the symbol. The symbol should now be highlighted.
- Right-click the highlighted symbol and select copy from the drop-down menu or use the shortcut key Ctrl + C to copy the symbol.
- To paste the copied symbol right click on the desired spot and select paste from the drop-down menu or use the shortcut Ctrl + V to paste in the desired spot.
- Alternatively, you can google search the desired symbol and copy it from there.
Note: Make sure the symbol you google searched is in text format and not an image.
- Using the Insert Symbol Dialog
In comparison to the other two methods, this one is more complicated. But with the very simple steps given below, it is going to be a piece of cake.
- Find the Insert tab on the top left of your word document.
- In the Insert tab, click on the symbol tab and then select More Symbols. The Symbol Dialog Box should now be open.
- Locate the desired symbol.
To locate the Envelope symbol in the dialog box, change the option to Wingdings in the Font drop-down. Next, in the bottom right corner of the dialog box, locate the character code field and type 002A. This should select the symbol you want to insert.
- Click the insert button.
- Another way is to double-click the symbol you want to insert if you already see it on the dialog box.
- Click the close button.
The desired symbol should now be visible on your word document.
Frequently Asked Questions
- Is pressing the Fn key enough on a tablet?
Yes, pressing the Fn key on your detachable keyboard will enable the numeric keyboard. You can find the same Fn key on the on-screen keyboard on your tablet.
- Can I use the same methods in Word online?
Yes, you can use all three methods in word online to insert any symbol. However, it is important to note that only the copy-paste method will work in the student subscription of Word 360. To use the other methods, you need to buy the full subscription.
- Can I change the size of the symbol?
Yes. To change the size of the symbol, you can highlight it and choose the size Font Size bar next to the Font Name bar on the top-left side of your word document.
Inserting the Mail/Envelope symbol
If you have reached so far and you are not breathing too hard, then you have successfully followed the simple steps and can see this symbol ✉ on your document. You can use any of the three methods described above to insert any desired symbol according to your need. All three methods are described in detail. You can now easily use the direct shortcuts with the right Alt Code, copy-paste the symbol, or use the Insert Symbol Dialog box. The general exceptions are applied to tabled keyboards only. If you have any general queries or comments, please feel free to use the comment section below and leave them there.
Also read How to Insert a Checkbox In Word (☒) with Screenshots?
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Contact US
Thanks. We have received your request and will respond promptly.
Log In
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips Forums!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts - Keyword Search
- One-Click Access To Your
Favorite Forums - Automated Signatures
On Your Posts - Best Of All, It’s Free!
*Tek-Tips’s functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Posting Guidelines
Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Students Click Here
how to : create a button in Word to email ?how to : create a button in Word to email ?(OP) 10 Apr 07 04:19 hello : i want to create a survey in Word format. i have 2 challenges here. 1. i want to create an radio button like excel one. 2. i want to create a button/icon in the survey form whereby it will capture the survey data in the document and then it will generate an email from the outlook apps. the email also includes To: email address + subject line as well. cheers Red Flag SubmittedThank you for helping keep Tek-Tips Forums free from inappropriate posts. |
Join Tek-Tips® Today!
Join your peers on the Internet’s largest technical computer professional community.
It’s easy to join and it’s free.
Here’s Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More…
Register now while it’s still free!
Already a member? Close this window and log in.
Join Us Close