Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail merge 1

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
I recently posted a question on how to open a word document from Paradox 9.

But now i need to know if it is possible to automate the Mail Merge in Word from within Paradox9. The document is already linked to the tables,I just need to complete the merge part.

ANy ideas? Maybe a macro?

Anyway, as always i appreciate any ideas or comments.
Richard
 
Check out OLEAuto in the ObjectPAL help files. A lot of folks use that, though I have no personal experience with it.

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Cleoman,

What did you wind up doing on mail merge with Word? I starting down that same path right now. I setup a system with OLE and Winfax pro a few years ago, is that the way you went or is there a simpler way to do this.

Thanks in advance

James D. Howard
 
I needed to create stickers (on dot matrix printers) for medicine containers and I could'nt get Paradox to set the report sizes i wanted, so I created a macro that ran once Word is opened to use a mail merge to get the data i wanted and then opened the word document from Paradox and automatically sent it to the printer.

What is it that you want to do exactly? I did this a while back so I'm a bit rusty, but if i can help, dont bother to ask.

Richard
 
I have an accounting system for contractors. They deal with a lot of correspondence between themselves and their subcontractors and suppliers. Some of this can be taken care of with form letters. Currently I have setup a form database that has the location and name of the document/spreadsheet to be accessed. I then display this database in the vendor form in a MRO that has a button on each record, each button label comes from the description of the form database. (IE: button 1 is labeled NOTICE TO PROCEED, b2 is RELEASE OF LIEN...) On the push button method of the button I have created the following code:



T = CREATE ":pRIV:__MERGE.DB"
WITH "VENDOR#" : "A6" ,
"VENDORNAME" : "A30" ,
"VENADD1" : "A30" ,
"VENADD2" : "A30" ,
"VENCITY" : "A30" ,
"VENSTATE" : "A2" ,
"VENZIP" : "A15" ,
"VENCONTACT" : "A30"
KEY "VENDOR#"
ENDCREATE
TC1.OPEN(":pRIV:__MERGE.DB")
TC1.EDIT()
TC1.INSERTRECORD()
TC1.VENDOR# = MAINKEY
TC1.VENDORNAME = VENDORNAME
TC1.VENADD1 = VENADD1
TC1.VENADD2 = VENADD2
TC1.VENCITY = VENCITY
TC1.VENSTATE = VENSTATE
TC1.VENZIP = VENZIP
TC1.VENCONTACT = VENCONTACT
TC1.POSTRECORD()
TC1.ENDEDIT()
TC1.CLOSE()

strDir = LOCATION
strDoc = APPNAME
IF NOT ISFILE(STRDIR+STRDOC) THEN
MSGSTOP("CAN NOT OPEN FILE","Reason: Can not find a file named "+ STRDIR+STRDOC+ "\"; please check the name.")
ELSE
ShellExecuteA(0,"open",STRDOC,"",STRDIR,0)
ENDIF

This allows my users to click on the desired form letter and manually run a mail merge with the exported vendor info. I would like to have the ability to automatically run the merge from within word based on a selection made in the form database. (IE if mailmerge="Y" then xxxx endif) I would also like to have the ability to save the document and reference it in another Notes database that is in our system. That way if they want to look up that correspondence they could.

Thanks for the reply, let me know if you have any ideas.

James D. Howard
 
Alright, this is what i did to get the automatic mail merge part going, but be warned this is not the most elegant of solutions, but it worked for me:

So basically you need to open Word, then under the Tools menu you'll find a macro option,then under that you'll see Record Macro. (Tools/Macro/Record Macro)

Then while recording a macro , I went through the word document completing a mail merge manually. The Macro recorder records what your doing and puts this into code in a custom Macro.

So then when I opend a specific Word document I would automatically run this macro from within and viola, it would create the merged document.

Although I think, this is most likely not the best solution, it is one that worked for me, and you'll basically have to play around with this one.

I dont know how you can make a selection from within Word based on the user's decision, but maybe you can make a document for each of the decisions, each with it's own custom macro.


Really hope this helps at least a litte bit
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top