My database has a form that displays information about members of an on-line forum. When I add a new member, I click a command button that launches an Outlook e-mail message addressed to the current record (the member whose name displays on the form). There’s nothing else in the message–just the e-dress. I’m thinking there must be a way, via VBA, to cause the new message to open with a standard “subject:” (e.g., Welcome to the forum!) and some boilerplate text in the message body. Can anyone suggest where to start. Thanks!
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Launch e-mail with boilerplate message (2003)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Launch e-mail with boilerplate message (2003)
- This topic has 6 replies, 4 voices, and was last updated 17 years, 6 months ago.
Viewing 0 reply threadsAuthorReplies-
WSjohnhutchison
AskWoody LoungerDecember 4, 2007 at 5:05 am #1086783Does your current code use Docmd.Sendobject to create the email or Outlook automation?
In either case you can specify the Subject and Body of the message in code, but the exact code would be a little different.
If you had two string variables strSubject and strMessage which held the text you wanted to use, this is the code using Docmd.sendObject
DoCmd.SendObject acSendNoObject, , , strTo, , , strSubject, strMessage, True
With Outlook automation you will still use two string variables, but then have something like:
With oMailItem
.To = strTo
.Subject = strSubject
.Body = strMessage
.Display
End With -
WSCaesar3
AskWoody Lounger -
WSHansV
AskWoody LoungerDecember 4, 2007 at 4:12 pm #1086829Change the line
strEmailAddress = “mailto:” & Me![MemberEmail]
to
strEmailAddress = “mailto:” & Me![MemberEmail] & “?subject=Hello World”
(You should, of course, substitute the appropriate subject). Instead of a fixed subject, you can also use an expression:
Change the line
strEmailAddress = “mailto:” & Me![MemberEmail]
to
strEmailAddress = “mailto:” & Me![MemberEmail] & “?subject=” & Me![SubjectText]
-
WSCaesar3
AskWoody Lounger -
WSHansV
AskWoody LoungerDecember 4, 2007 at 4:58 pm #1086846You can also add some body text, but a) there is a limit to the length of the mailto string, and
you can’t enter line breaks.
Example:
strEmailAddress = “mailto:” & Me![MemberEmail] & “?subject=Hello World&body=Welcome to our forum.”
If you want to set a body text with line breaks, consider using DoCmd.SendObject.
-
WSBodders
AskWoody LoungerDecember 4, 2007 at 5:00 pm #1086847Lucas
You could create a table to contain the boilerplate text with a line number field in it, and then read it using a loop into a string variable. I have done this before, and used asterisks to bracket variables, e.g. *username*. Once the string has been created, you then use the Replace function to substitute the actual variables for the *…* text.
HTH
Nick
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
6 hours, 44 minutes ago -
Search Forums only bring up my posts?
by
Deo
6 hours, 58 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
18 hours, 26 minutes ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
11 hours, 3 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
19 hours, 3 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
1 day, 5 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
1 day, 6 hours ago -
Disengage Bitlocker
by
CWBillow
20 hours, 15 minutes ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
1 day, 8 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
6 hours, 53 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
1 day, 15 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
1 day, 15 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
1 day, 19 hours ago -
New PC transfer program recommendations?
by
DaveBoston
24 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
1 day, 23 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
1 day, 23 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
1 day, 11 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
15 hours, 57 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
1 day ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
2 days, 18 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
1 day, 16 hours ago -
System Restore and Updates Paused
by
veteran
2 days, 21 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
2 days, 8 hours ago -
Turn off right-click draw
by
Charles Billow
3 days ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
3 days, 3 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
10 hours, 29 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
3 days, 5 hours ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
3 hours, 33 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
3 days, 11 hours ago -
KB5060842 Issue (Minor)
by
AC641
1 day, 23 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.