Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
OK, I do not know what is going wrong in this case. Word stores all
these values in text fields in a Jet (Access) database and it should save a record even if you do not put anything in any of the fields. The only thing I can suggest is that you create a new .mdb that that copies all the data from the existing one but is recognised as an OAL by Word. I don't think you can do it in Access (if you have that) - although you can try. The key thing is that however you do it, you need to locate your OAL (it should be in a .mdb file) and make a backup copy first. You can try the following macro - I have not tested it properly but it used to do the job here. There are some general instructions for setting up Word macros on Graham Mayor's site at http://www.gmayor.com/installing_macro.htm In this case you should a. close any Word mail merge main documents that are linked to the OAL b. make a copy of the OAL c. when you have copied the macro code into a module in the VB Editor, - ensure that you have put any "wrapped" lines of code back together - use the VB Editor's Tools-References menu option to locate the following 2 libraries and check them: - Microsoft ActiveX Data Objects 2.7 Library - Microsoft ADO Ext. 6.0 for DDL and Security (If you don't have libraries with those names, choose the closest, e.g. Microsoft ActiveX Data Objects 2.6 Library - in strSourceOAL, specify the pathname of the copy OAL you made in step (b) - in strTargetOAL, specify the pathname of the OAL you want to create. The .mdb must not already exist, but the folder it is in must already exist d. run the macro e. if all goes well, create a new mail merge main document, attach the new data source, and check that the data you expect is there. Then try editing it and see if the Customize Columns button is now available. If it is, then you can replace your old data source and continue. '---------------------------------------------- Sub CreateOalAndCopy() ' Peter Jamieson 2009. Needs testing and error management ' Specify the OLE DB Provider. Const strProvider = "Microsoft.Jet.OLEDB.4.0" ' In the following line, specify the full path ' name of the Office Address List .mdb you are ' trying to fix Const strSourceOAL = "c:\a\source.mdb" ' In this line, specify the full path name ' of a .mdb file. The folder must exist ' but the .mdb will be created Const strTargetOAL = "c:\a\target.mdb" Dim objCatalog As ADOX.Catalog Dim objProcedure As ADOX.Procedure Dim objTable As ADOX.Table Dim objTables As ADOX.tables Dim objView As ADOX.View Dim objViews As ADOX.views Dim objCommand As ADODB.Command Dim objParameter As ADODB.Parameter Dim strCommandText As String Set objCatalog = New ADOX.Catalog Set objCatalog.ActiveConnection = objCatalog.Create( _ "Provider='" & strProvider & "';" & _ "Data Source= '" & strTargetOAL & "';" & _ "Jet OLEDB:Engine Type=5;") Debug.Print objCatalog.ActiveConnection Set objCommand = New ADODB.Command Set objCommand.ActiveConnection = objCatalog.ActiveConnection ' Office_Address_List should be the only Table ' Create a copy of it strCommandText = " SELECT *" & _ " INTO [Office_Address_List]" & _ " FROM [Office_Address_List]" & _ " IN '" & strSourceOAL & "'" ' do it objCommand.CommandText = strCommandText objCommand.Execute ' Office Address List should be the only query. ' Create it objCommand.CommandText = _ " CREATE VIEW [Office Address List] AS" & _ " SELECT *" & _ " FROM [Office_Address_List]" objCommand.Execute 'objCatalog.views.Append "Office Address List", objCommand Set objCommand = Nothing Set objCatalog.ActiveConnection = Nothing Set objCatalog = Nothing End Sub '---------------------------------------------- Peter Jamieson http://tips.pjmsn.me.uk Visit Londinium at http://www.ralphwatson.tv Brandon A. wrote: 2003. Data source is a Word database? I'm not sure how many columns default but I have added several. If I fill the information in on the database it all saves however if I am in my Word template and adding new rows to the database via the edit function under 'mail merge recipients,' the data does not all save. I would like to use Excel spreasheet source but then I don't have the option to edit and add new once in the Word doc. Plus I would have to format everything in Word. "Peter Jamieson" wrote: Which version of Word? What is the data source (you mention 43 fields, but for example if you create a new data source in Word, by default I think there are only about 13) ? Peter Jamieson http://tips.pjmsn.me.uk Visit Londinium at http://www.ralphwatson.tv Brandon A. wrote: After completing all 43 fields and clicking "add new" or "close," some of the data entered will disappear. There is no rhyme or reason that I can identify. I will enter the missing fields and close again and sometimes the data will remain, sometimes it won't. Any ideas why all the data is not saving? Thank you. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Editing Recipients in Word 2007 Mail Merge | Mailmerge | |||
Editing Mail Merge Recipients | Mailmerge | |||
How do I print Mail merge recipients data list | Mailmerge | |||
editing mail merge recipients | Mailmerge | |||
Editing Mail Merge Recipients using Excel 2003 database | Mailmerge |