Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2016, 11:22 AM
Gadget Gadget is offline Including Text Form Field info in the subject line of an email Windows 10 Including Text Form Field info in the subject line of an email Office 2016
Novice
Including Text Form Field info in the subject line of an email
 
Join Date: Sep 2016
Posts: 2
Gadget is on a distinguished road
Default Including Text Form Field info in the subject line of an email

Am using the following to send a Word form as an email:

Private Sub Document_New()
Options.SendMailAttach = True
ActiveWindow.EnvelopeVisible = True
With ActiveDocument.MailEnvelope.Item
.Subject = "Hospitality Services Request Form - [Name of Lawyer]"
.Recipients.Add "#Room Booking - HFX; #Housekeeping"
End With

If ActiveWindow.View.TableGridlines = True Then
ActiveWindow.View.TableGridlines = False
End If
End Sub



Is there a way to include information a user types into a Text Form Field (Bookmark name: bkLawyer) in the subject line of the email?
Reply With Quote
  #2  
Old 09-08-2016, 08:43 PM
macropod's Avatar
macropod macropod is offline Including Text Form Field info in the subject line of an email Windows 7 64bit Including Text Form Field info in the subject line of an email Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You might try something along the lines of:
Code:
Private Sub Document_New()
Options.SendMailAttach = True
ActiveWindow.EnvelopeVisible = True
With ActiveDocument.MailEnvelope.Item
  .Subject = "Hospitality Services Request Form - " & _
    ActiveDocument.Bookmarks("bkLawyer").Range.Text
  .Recipients.Add "#Room Booking - HFX; #Housekeeping"
End With
ActiveWindow.View.TableGridlines = False
End Sub
However, given it's a Document_New macro, it's not apparent to me that your 'bkLawyer' bookmark would have any meaningful content at that stage.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Including Text Form Field info in the subject line of an email Gadget Word 0 09-08-2016 10:55 AM
Including Text Form Field info in the subject line of an email Outlook - Add text to subject line when sending a reply email rparker85 Outlook 3 12-12-2011 10:26 AM
Copy plain text message including sender, recipient, and subject distancesprinter Outlook 0 01-22-2010 12:49 PM
Including Text Form Field info in the subject line of an email How can I fill in form I received in email that used underlines instead of text field Gail L. Word 2 05-17-2009 12:38 PM
Including Text Form Field info in the subject line of an email getting additional characters in email subject line namishtiwari Outlook 1 04-21-2009 11:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft