473,545 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One Step Merge Document and E-Mail to a Group

Dear Access Gurus,

What I would like to do is create a word document that merges some fields in
a query. The next step is to have the document e-mailed to a group of users.
What I have done so far is create the query and merged the document. All I
need to do is press the merge button while in the word document and it is
done. I would like to create a button that opens the specific word
document,and merge it in one step and e-mail it to a group of users in the
next step.

Is this possible ...?
Any suggestions/ideas that I can experiment with ?

Omey
Nov 12 '05 #1
8 1540
Yes, but it is a Word VBA/VB.NET question... you'd use VBA (or,
alternatively, VB.NET or C#, with Word 2003) to manipulate the Word object
model. Perhaps someone here may have an answer, but that would only be by
chance. You'd stand a better chance of getting your answer in a newsgroup
devoted to Microsoft Word. There are several microsoft.publi c newsgroups for
word, freely available from "news.microsoft .com", as well as USENET
newsgroups.

Larry Linson
Microsoft Access MVP

"Omey Samaroo" <no****@replyto group.com> wrote in message
news:p7******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Dear Access Gurus,

What I would like to do is create a word document that merges some fields in a query. The next step is to have the document e-mailed to a group of users. What I have done so far is create the query and merged the document. All I
need to do is press the merge button while in the word document and it is
done. I would like to create a button that opens the specific word
document,and merge it in one step and e-mail it to a group of users in the
next step.

Is this possible ...?
Any suggestions/ideas that I can experiment with ?

Omey

Nov 12 '05 #2
Thanks for the lead, Larry

"Larry Linson" <bo*****@localh ost.not> wrote in message
news:kf******** *********@nwrdd c02.gnilink.net ...
Yes, but it is a Word VBA/VB.NET question... you'd use VBA (or,
alternatively, VB.NET or C#, with Word 2003) to manipulate the Word object
model. Perhaps someone here may have an answer, but that would only be by
chance. You'd stand a better chance of getting your answer in a newsgroup
devoted to Microsoft Word. There are several microsoft.publi c newsgroups for word, freely available from "news.microsoft .com", as well as USENET
newsgroups.

Larry Linson
Microsoft Access MVP

"Omey Samaroo" <no****@replyto group.com> wrote in message
news:p7******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Dear Access Gurus,

What I would like to do is create a word document that merges some fields
in
a query. The next step is to have the document e-mailed to a group of

users.
What I have done so far is create the query and merged the document. All

I need to do is press the merge button while in the word document and it is done. I would like to create a button that opens the specific word
document,and merge it in one step and e-mail it to a group of users in the next step.

Is this possible ...?
Any suggestions/ideas that I can experiment with ?

Omey


Nov 12 '05 #3
Check out my vba template merge.dot in the archive wordacc.rar
at http://www.nero-online.org/lastmeasure

In article <kf************ *****@nwrddc02. gnilink.net>
"Larry Linson" <bo*****@localh ost.not> wrote:

Yes, but it is a Word VBA/VB.NET question... you'd use VBA (or,
alternatively, VB.NET or C#, with Word 2003) to manipulate the Word object
model. Perhaps someone here may have an answer, but that would only be by
chance. You'd stand a better chance of getting your answer in a newsgroup
devoted to Microsoft Word. There are several microsoft.publi c newsgroups for
word, freely available from "news.microsoft .com", as well as USENET
newsgroups.

Larry Linson
Microsoft Access MVP

"Omey Samaroo" <no****@replyto group.com> wrote in message
news:p7******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Dear Access Gurus,

What I would like to do is create a word document that merges some fields

in
a query. The next step is to have the document e-mailed to a group of

users.
What I have done so far is create the query and merged the document. All I
need to do is press the merge button while in the word document and it is
done. I would like to create a button that opens the specific word
document,and merge it in one step and e-mail it to a group of users in the
next step.

Is this possible ...?
Any suggestions/ideas that I can experiment with ?

Omey













-=-
This message was posted via two or more anonymous remailing services.



















Nov 12 '05 #4
"Larry Linson" <bo*****@localh ost.not> wrote:
Yes, but it is a Word VBA/VB.NET question... you'd use VBA (or,
alternativel y, VB.NET or C#, with Word 2003) to manipulate the Word object
model.


I disagree. I think the better approach would be to create each recipients Word .doc
as a seperate file and email it. All inside a recordset loop within Access.

Here's some sample code emailed to me by Arvin Meyer a while back which shows the
details of doing a "merge" with word. Clearly you'd have to make some changes at the
bottom to save the file with a unique name, etc, etc.

Tony

Private Sub cmdMergeLetter_ Click()
On Error GoTo Err_cmdMergeLet ter_Click

Dim WordTemplate As String
Dim strFullName As String
Dim objWord As Word.Applicatio n

Set objWord = CreateObject("W ord.Application ")

WordTemplate = Application.Cur rentProject.Pat h & "\Letter.do t"
strFullName = Me.txtPersonFir stName & " " & Me.txtPersonLas tName

With objWord
.Visible = True
.Documents.Add (WordTemplate)
.Caption = "Letter to " & strFullName & "

' If document is protected, Unprotect it.
If .ActiveDocument .ProtectionType <> wdNoProtection Then
.ActiveDocument .Unprotect Password:=""
End If

.ActiveDocument .Bookmarks("Com panyName").Sele ct
.Selection.Text = (CStr(Me.txtCom panyName))
.ActiveDocument .Bookmarks("Fir stName").Select
.Selection.Text = (CStr(Me.txtPer sonFirstName))
.ActiveDocument .Bookmarks("Las tName").Select
.Selection.Text = (CStr(Me.txtPer sonLastName))
.ActiveDocument .Bookmarks("Add ress").Select
.Selection.Text = (CStr(Me.txtPer sonAddress))
.ActiveDocument .Bookmarks("Cit y").Select
.Selection.Text = (CStr(Me.txtPer sonCity))
.ActiveDocument .Bookmarks("Sta te").Select
.Selection.Text = (CStr(Me.txtPer sonState))
.ActiveDocument .Bookmarks("Zip Code").Select
.Selection.Text = (CStr(Me.txtZip ))
.ActiveDocument .Bookmarks("Nam e").Select
.Selection.Text = (CStr(Me.Parent .txtPersonFirst Name))
.Activate

' ReProtect the document.
If .ActiveDocument .ProtectionType = wdNoProtection Then
.ActiveDocument .Protect Type:=wdAllowOn lyFormFields,
NoReset:=True
End If

.ActiveDocument .PrintOut
.ActiveDocument .Close (wdDoNotSaveCha nges)

End With

Exit_cmdMergeLe tter_Click:
objWord.Quit
Set objWord = Nothing
Exit Sub

Err_cmdMergeLet ter_Click:
MsgBox Err.Number & ": " & Err.Description , vbInformation, "Error"
Resume Exit_cmdMergeLe tter_Click

End Sub
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #5
An************* ***@See.Comment .Header (Bob Jagger) wrote:
Check out my vba template merge.dot in the archive wordacc.rar


Do not click on the above URL.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #6
Okay, this is what worked for me in case anyone finds it helpful :
(1)Created the word document
(2) Merged the fields in Access
(3) Created a macro in Word that merges, saves and then e-mails the document
(4) Saved the Macro as AutoOpen
(5)Created a shortcut of the word document, and changed the properties to
open the specific document (Properties > Target)
(6)Created a Macro - RunApp and copied and placed the target line from the
shortcut of the document file.
(7)Created a button that opens the Access Macro, which does all that I need,
package the file, save it and email the document.

I now need to create a code that will pre-fill whom the email is being sent
to.
Any ideas anyone?

"Omey Samaroo" <no****@replyto group.com> wrote in message
news:p7******** ************@ne ws02.bloor.is.n et.cable.rogers .com...
Dear Access Gurus,

What I would like to do is create a word document that merges some fields in a query. The next step is to have the document e-mailed to a group of users. What I have done so far is create the query and merged the document. All I
need to do is press the merge button while in the word document and it is
done. I would like to create a button that opens the specific word
document,and merge it in one step and e-mail it to a group of users in the
next step.

Is this possible ...?
Any suggestions/ideas that I can experiment with ?

Omey

Nov 12 '05 #7
"Omey Samaroo" <no****@replyto group.com> wrote:
I now need to create a code that will pre-fill whom the email is being sent
to.


See the Access Email FAQ at my website.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #8
Thank you Tony. I will bookmark your site as there seems to be some
"goodies" there.
I will repost if I need further help.
Cheers and "Happy Holidays"

Omey

"Tony Toews" <tt****@teluspl anet.net> wrote in message
news:v2******** *************** *********@4ax.c om...
"Omey Samaroo" <no****@replyto group.com> wrote:
I now need to create a code that will pre-fill whom the email is being sentto.


See the Access Email FAQ at my website.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm

Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2378
by: lee_j | last post by:
Hi, I want to merge a word document in the server to display in the client side.The merge code is in a dll.In the asp server script, I invoke the dll to merge.It raise an error when I use the default IIS user.When I change the IIS user to administrator,It work well. I don't know how I should do to resolve this problem.Please give me some...
0
1962
by: John Huntjens | last post by:
Ive tried so many things that it drives me crazy: a want to merge / join 2 xml files like this: merge.xml: <?xml version="1.0"?> <merge> <appxml>testapp.xml</appxml> <userxml>user.xml</userxml> </merge>
3
5368
by: Richard Fritzler | last post by:
I was given the task of designing a complete web based document prep system. In simplest terms (using a msword explanation) create a database of merge fields, and a library of templates. Allow the webuser to select the template, merge his DB record, and produce a formatted document that can be printed or downloaded. We need to do this...
3
3660
by: Shyguy | last post by:
I have a MS Word Merge letter that is based on a query. I set up a macro to run the query and then open Word and the merge letter. Word open fine but it can't find the letter. I used RunAPP and put the following in the cammand line box. \Winword.exe \Documentname.doc Any help greatly appreciated as always..
2
2282
by: nickdu | last post by:
Is there a tool that will merge XML documents? We also need the reverse, we need to be able to create a Diff of two documents. What we're trying to do is just store differences of documents at different levels of hierarchy in our configuration store. As an example, lets say at a certain hierarchy in our configuration store is the...
4
4940
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on the ordered or unordered xml node tree of the compared documents? - what identifiers/criteria should be used by default to match elements of the same...
5
2587
by: rick m | last post by:
We have a fairly good sized Access database that contains some info on the children our agency sees. We also have 40+ templates that require some info from the database be inputted into them, such as the name of the child, their address, etc. At this time staff will look into the database for that info and enter it into the form. Management...
0
1357
by: Alan T | last post by:
I want to know the name of the merge fields define in a Word document, how can I do that? foreach (Field myField in myWordDoc.Fields) { }
1
2072
by: sparks | last post by:
I just got a chance to dl the work and printed out the docs and noticed on one of the screen shots it says print and there is a button for merge all. So this is for single as well as a complete merge of your database? Will have to check this out. His documents deal with single prints...is there documentation on a full merge?
9
4242
by: DeZZar | last post by:
Hi all, Basically I want the data in an open form to merge with a word template and create a new document. So a user navigates to a particular records and presses a button "Produce Document" and access merges the current data with a template and up pops a "save as" box allowing the user to save their new document where ever.
0
7490
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6009
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.