Modules & VBA :: Mail Merge And Create Individual Files
Jan 11, 2014
I am looking to perform a mail merge from access to Publisher. I have linked everything together and got everything looking the way that I want it to look however...
What I want to do is when I perform the mail merge I would like publisher to save a copy of each individual record from the database as a specific file based on one field of the mail merge.
I will try to clarify...
One of the mail merge fields is ClientAccountNumber I would like the merge to save a copy of the publisher file into c:mailmerge as a PDF including the year 2014.
So this file(s)for example would look like
C:mailmerge123456 - 2014.pdf C:mailmerge123457 - 2014.pdf etc...
Code:
Sub MailMerge()
'
' Macro1 Macro
Dim TempDocCreate
Dim FileNameTemp As MailMergeDataField
Set FileNameTemp = Application.ActiveDocument.MailMerge.DataSource.DataFields.Item("Box 22 Rcp Acct No")
With ActiveDocument.MailMerge.DataSource
Application.ActiveDocument.ExportAsFixedFormat pbFixedFormatTypePDF, Filename:= _
"L:Operations DatabaseProjects1042PublisherPDF2011 Merge" & "FileNameTemp" & " - 2011" & ".pdf"
End With
View Replies
ADVERTISEMENT
May 12, 2005
Hi I wonder if anyone can help? I have looked through prevous posts and cant find any answers that fit what I need to do. For reference I am using Access 97 and Word 97.
I want to be able to have a client record open in a form and click a button and for that particular record to merge with a preformatted word doc. I have created a query that gives me all the fields I need (as they are over multiple tables) and I can successfully combine this into a mail merge. But it currently takes *all* the records and I want it to only do the current one. I also want user to be able to click a button somewhere on the form that automates this process for him. Is this possible?
I have investigated transfertext and filled in what I think I should have but it seems to do nothing. It creates another (unopenable) file in the same folder as the word doc and does nothing else. But I am using the 'export word for windows merge' in the tranfertext action?
If I can only crack this I will be happy! Many thanks in advance for any help
DD
View 3 Replies
View Related
May 8, 2012
I have a database for my business, which lists clients details. Within this, I have a query that runs off receipts (one customer, many receipts), as I run a private school and people pay me monthly. I use this query to run off a Mail Merge letter within Word, but it's difficult, having to close the db and open a Word document and then relink it.
Is there any way that some coding could be used within the db so that I can add a button and just print out that record into a mail merge document?
View 1 Replies
View Related
Jul 23, 2015
What i would like to do is replace the DoCmd.OutputTo line with a DoCmd.SentTo line to email the reports to the appropriate faculty instead of just saving them in the folder.
I used this line but it did not work: DoCmd.SendObject (acSendReport, , acFormatPDF, "vtblfaculty.email&'@xxx.edu'","me@xxx.edu",,"test ","this is a test",-1,,)I have been working on this forever!
Public Sub something3()
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT DISTINCT tblsection.Faculty, left(vtblfaculty.firstname,1)&vtblfaculty.lastname AS fn, vtblfaculty.email FROM vtblfaculty INNER JOIN tblsection ON tblsection.faculty=vtblfaculty.faculty WHERE term=" & Forms!frmimport!cbxTerm)
[code]...
View 6 Replies
View Related
Sep 8, 2014
Any simple working mail merge application with a one to many field filling into the word document. I have no problem with a one to one, but if the subform has 2 or more associated records related to the main form, I cannot pass all the fields. Build a recordset loop or concatenated script so I can learn from it and add it to an existing project.
Example:
main form: CustomerID, Customer, Address
subform: ProductID, Product, Cost, fk_CustomerID
Sample data:
main form: 1, James Smith, 118 Clover Lane
subform entry 1: 4, Small Shipping Boxes, 2.00, 1
subform entry 2: 5, packing tape, 1.75, 1
subform entry 3: 3, Large Shipping Boxes, 3.00, 1
View 2 Replies
View Related
Aug 7, 2013
I have a report in my database with a button called "MailMerge".
My aim is that when clicked, this will open a word document, that has already been created, but automatically complete the merge based on the data in a table.
The catches:
1) I need to be able to ask the user the content of the word document from within access, and automatically populate it
2) I need to be able to ask the user who has written the word document and automatically populate it
3) I need to use a document which I have already created, because of various reasons, but obviously the merge fields can be updated.
Currently, I am trying to append the results of the query into a table, TBL_Merge and then use code to both ask the questions above, and then complete the merge.
View 1 Replies
View Related
Jun 19, 2014
I'm wondering if it's possible to set up an automatic Outlook mail merge with attachments from Access. We have several account managers, and each one receives a different version of the same report - filtered to his/her accounts. For now, I have set it up for the user to select the account managers and hit "Print Reports" to save each individual report into a destination folder. The user then uses an email template, attaches the report, and sends the email to an account manager. She has to send this email separately to each account manager.
View 3 Replies
View Related
Jun 11, 2014
I know this is possible (e.g. opendatasource) but search as I might I can't get the exact code.
Scenario: Multiple front ends, in different folders, linked to single back end.
When mail merging, a temp table is created in FE - thereby different source for each user.
The Word doct is linked to a source (via Mail Merge) and I want to change that source according to the logon of the user, which is held on an open form.
Ideally like:
Case Mary use C: Db1 emptable
Case Tom use C:Db2 emptable
View 4 Replies
View Related
Feb 18, 2015
I have an access .adp project which is linked to a sql server tables (2008 r2), I have a button on an access form which I click and successfully gets customer details based on a query. What I wanted to know is when I am viewing a specific record i.e. details for Patient Number X, when I click on a mail merge button from their record form can the mail merge document only open with their details not all customers?
I have tried to delve into vba and modules to acheive this but I am a newbie.
View 4 Replies
View Related
Aug 14, 2013
I might be able to get "super easy mail merge" to work, but the problem is i want clicking the "merge" button to launch a file chooser box- so i can navigate to the word doc i want to use for the merge (destination doc will change with the currently selected record- i'm not merging a single record, however).
Basically i want to do exactly what right clicking on a table/query, then choosing "export" then choosing "merge with word" does (access 2007).
Can't do as a report because we may have "complex" letters- with graphics and/or tables.
why is something that is a simple right-click menu option so difficult to automate??
View 4 Replies
View Related
Aug 20, 2013
I basically have a form which the record source is either from a table or query and all I would like to do is to have a button which when pressed will open up a previously created word template and insert all relevant fields into the template. First Name, Last Name, Address etc.
View 1 Replies
View Related
Mar 9, 2014
I often create contract using mail merge. I have an access file that I want to use as data source for word file. But it does not automatically.
Please see the attached file !
If there are 1 customer and 1 property, I do not need to do anything. Conversely, if there are many customers and many properties, I take time to manipulate.
Firstly, I open the word file. I have to copy and paste paragraphs that I want. Highlight of the original paragraphs is blue.
Secondly, I click 'Insert Word Field' -> select 'Next Record'.
In short, I want to use VBA in access file to automatically perform the steps that I have outlined.
View 1 Replies
View Related
Sep 4, 2013
My DB is merge in a currency field set to 2 decimal places into word. It's doing this by declaring the fields as variable, calling an instance of work then dropping the values into the bookmarks. All works fine....
When a value is 360.64 is fine, but when it's something that ends with a 0 (360.60) - is loses the 0 giving me 360.6.
View 2 Replies
View Related
Sep 15, 2014
I am trying to create VBA code (I have very little experience of VBA) to recreate a parameter query mail merge, which Access 2013 cannot achieve with the controls provided.I think that I need to assign a variable to the value of a control on my form then assign that variable to the relevant criteria section of my query.
Code:
DIM RefNo as String
DIM IDNo as String
RefNo = Me.[Reference Number].Value
IDNo = Me.Text582.Value
DoCmd.OpenQuery SORTER
How do you paste into criteria?
From there I would like to do a Word Mail Merge by having VBA open a document in Word, then activate the Merge to a New Document instruction.
View 14 Replies
View Related
Mar 18, 2014
I am currently working o a Library Management System. most of the work is done but there remains two major problems.
I want to calculate the fines that a member will have automatically on a form. i have a basic pseudocose which is
IF Loan.returned=0 AND ReturnDate<Today{note- i.e. date()Today(), etc.}
THEN Loan.fine_BDT=20*(Today-Loan.ReturnDate)
Note2- The form has the following fields from a query which is connected to table loan-
LoanID
LoanDate
ItemID
MemberID
ReturnDate
DateReturned
Returned(Yes/no)
2. The other one is with the Mail merge. i Want to use a query to supply the data for a mail merge. However, since the database id encrypted with a password it cannot be reached.
I am currently using Access 2007.
View 7 Replies
View Related
Jun 19, 2014
I have the following code which errors on line
Code : .OpenDataSource Name:=CurrentProject.FullName, SQLStatement:="SELECT * FROM [qryMailMerge]"
The error (Error has occurred: The database has been placed in a state by user 'Admin' on machine 'W74XXXXXX' that prevents it from being opened or locked) appears in the Word document.
Code:
Public Sub CreateWordToPDF(strWordFile As String, strPDFFile As String, strSQL As String)
'Call CreateWordToPDF("C:Doc1.doc", "C:Doc1.pdf", "SELECT * FROM [qryMailMerge]")
Dim objWord As Word.Application
Dim docWord As Word.Document
'Open MS Word using early binding.
Set objWord = New Word.Application
Set docWord = objWord.Documents.Open(strWordFile)
[Code]......
View 8 Replies
View Related
Dec 23, 2014
I have a series of 7 separate Access 2010 programs that are designed to run under the control of a scheduler, and they must always finish. Errors are trapped and logged but mustn't stop the processes completing.
What I'm trying to do now is to create a single master control program that runs each individual application, one after the other, in order. And each individual app cannot start until the previous one is finished.how to call a separate Access program and know when it has finished.
View 2 Replies
View Related
Feb 3, 2014
I have created a database that generates a report with customer debts. I have a lot of customers and in a report each page is a different customer with individual debts info. What i would like to do is to create a button and distribute individual report page as pdf to individual customer by email. I'm using Lotus notes. I have searched the forums i found something but it was not what i was looking for.
View 1 Replies
View Related
Jul 20, 2005
When applicable, I have letters in Word already set up to show the cc: information at the bottom. However, Management needs a statement added to the bottom of the letters that ONLY show the cc:
I am having a slight problem trying to figure out how to make this statement show up only on certain letters.
Does anyone have any thoughts that could help me? I'd appreciate it very much.
View 2 Replies
View Related
Dec 28, 2005
I am totally new to Access and this is my first database.
I have a database for volunteers in which table A is basically a calendar and table B a list of volunteers with their details.
What I want to do is construct a report that will allow me to produce a mail merge letter such that:
1. One volunteer, with his/her information, is selected from table B and inserted into a mail merge letter. (The volunteer selected will change from letter to letter).
2 Certain days are selected from table A and added to the mail merge letter. This information will be the same in all letter.
I have posted a separate thread asking how I can make the selection of days in (2) above so you can assume that I know how to make the selection within table B.
How do I proceed?
If anyone knows a good example of this type of report then i will be extremely grateful.
View 3 Replies
View Related
Jan 23, 2006
I have a table that has, among others, Address1, Address2 and Address3. If Address2 andor Address3 are empty for a particular record, I get blank lines in the Word doc. How do I prevent these blank lines?
View 2 Replies
View Related
Apr 12, 2006
Hi, i have set up a mail merge between a query and a word document. My system is a system that processes transactions from an online cd shop. I have made it so that each cd that is bought by each customer is a different transaction in a transaction table, and each transaction is given an order number to group them. How do i get the mail merge to show all the transactions in an order on the invoice in my word doc because at the moment, even if i add two of the title name fields, they both show the same transaction.
View 4 Replies
View Related
Apr 2, 2007
Anyone have a good online resource for generating a single thank you letter, eg. by way of a mail merge using MS Access 2003 with Word 2003? I know you need to write a form letter first with various fields that conincide with fields in Access. I have done this many times with large mailings but need to know how to write individual letters for thank yous, invites, etc.
Thanks in advance
View 4 Replies
View Related
Feb 15, 2007
Hi,
I am editing the design of a census, and I would like to be able to mail merge form the query directly to a new document in microsoft word...so you can create the document and then merge to it, is this possible using a macro or VBA? I can't work out how to do it!! The query name is "List of Families" and I want to merge to a blank document, so I can create a different document everytime...as the letters aren't circulars!
Chris
View 1 Replies
View Related
Oct 20, 2004
I just finished creating an access file. Here are the contents:
TABLE Customers - Includes email, contact name, company name, address, zip, city, etc.
TABLE Materials - Includes company name and material. Each record is listed as a company with a material requested. Companies are listed multiple times, as they are unique records because the materials are different.
I have Company name set up as the primary key, and it sets the relationship between the two tables
I have a Report fully working. The first page is a letter with the customers' mailing info at the top.
The second page is a list of all the materials this company ordered for the 2004 year.
The report pulls from a QUERY that comes from the customers table and the materials table.
This report is hundreds of pages long, as we have multiple customers who order many materials each.
My question is "How do I mail merge this report out to the customer?" I do not want to send each customer the whole 500 page report, but only their specific record that they should receive.
I do not care if I have to merge with Word, Outlook, etc. I just dont want to have to send these out individually.
I hope that makes some sense.
PLEASE HELP!
-Preston
View 3 Replies
View Related
Jul 20, 2005
When applicable, I have letters in Word already set up to show the cc: information at the bottom. However, Management needs a statement added to the bottom of the letters that ONLY show the cc:
I am having a slight problem trying to figure out how to make this statement show up only on certain letters.
Does anyone have any thoughts that could help me? I'd appreciate it very much.
View 6 Replies
View Related