Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2010, 12:02 PM
Kimberly Kimberly is offline custom toolbar with buttons to open new docs based on templates Windows 7 custom toolbar with buttons to open new docs based on templates Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default


Quote:
So, my first question is when you save a new document that was created from a mail merge template, why would it ask me for the source each time?
It shouldn't! It seems like you are not saving the finished document, but instead saved the merge doc underneath....

When you 'merge to a new document', it makes a new, finished document that is not linked to the data source. The file that is still linked to the data source is underneath the finished document. If you have your Show/Hide turned on, you can see the section breaks in the finished document.

When you double-click on a template, you are opening the template (which you would only do when you are not happy with the template and wish to edit it for future use), not making a document based on the template. Opening a template to use it eliminates the point of having a template.



Please do this:
Either verify that you have a template that is connected to the data source and includes merge fields. Then close all instances of Word completely and then open Word and use the code I provided (edited to change the path to the template), to make a macro,


or create a new template and write your own macro

Here are the steps...
  1. Close all instances of Word completely
  2. Open Word
  3. Create a new document
  4. Start a mail merge... connect to the data source and insert the merge fields. You can preview them if desired, but don't complete the merge
  5. File > Save as.. document template... Word will want to save this in the Templates folder. Do so for now, you can move it later.
  6. Close the template
  7. Record a macro... do these steps while recording:
  8. File > New > Templates on My Computer
  9. Double-click on your new template - now you might have to say OK to the SQL dialog box
  10. Click Merge to New Document button
  11. OK to the all records dialog box
  12. Stop Recording
  13. Close everything that is open
  14. Run the macro to test it
After the macro has run, save the file that is on top. Close without saving the other file.
Reply With Quote
  #2  
Old 06-15-2010, 07:41 AM
Brandi Brandi is offline custom toolbar with buttons to open new docs based on templates Windows XP custom toolbar with buttons to open new docs based on templates Office 2003
Novice
custom toolbar with buttons to open new docs based on templates
 
Join Date: Jun 2010
Posts: 13
Brandi is on a distinguished road
Default

I am attaching my template Petition.dot and also the data source which is one table in an Access database. Maybe you can see what might be wrong. Every time I record a macro and try to run it, it tells me the "requested object is not available" and is not finding the data source.

If I manually double click Petition.dot, then it says it is going to run the SQL and finds the data source. When I click Merge to New document, it wants to save the connection to the data source.

Here is my macro:
Sub Test()
'
' Test Macro
' Macro recorded 6/15/2010
'
Documents.Add Template:= _
"C:\Bergemann\Forfeiture\WordMailMerge\Petition.do t", NewTemplate:=False, _
DocumentType:=0
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
Windows("Letters1").Activate
End Sub

Thank you.

Brandi
Attached Files
File Type: zip Petition.zip (6.4 KB, 15 views)
File Type: zip Forfeiture.zip (13.5 KB, 13 views)
Reply With Quote
  #3  
Old 06-15-2010, 02:10 PM
Brandi Brandi is offline custom toolbar with buttons to open new docs based on templates Windows XP custom toolbar with buttons to open new docs based on templates Office 2003
Novice
custom toolbar with buttons to open new docs based on templates
 
Join Date: Jun 2010
Posts: 13
Brandi is on a distinguished road
Default

I am stumped. I believe I have done everything you said.
Nothing seems to work as I need it to.

1. I need to open a document based on a template from a network location. Is this possible? It cannot be placed in the Templates folder.

Currently I am opening a document by double clicking the dot file. A document opens and asks to link to the SQL source. When I choose Merge to New Document, Letters1.doc opens. This is the document I save. When I open Letters1.doc, it still asks to link to the SQL source, and then it displays the document with the saved data (no matter what the source currently is) If I was to choose File, New, Templates on My Computer, I don't see how I can point to the dot file on my network drive.

2. Once I have Merged to a New document and saved the new document' I don't want to be prompted to open the SQL source when I open that saved document.

3. I am trying to attach macros to buttons that will open a new document based on my template. The macros keep saying "requested object is not available" and yet if I double click the dot file, I am prompted for the data source and a new document opens.

Should I be able to do what I want to do?

Thank you.
Brandi

If you are tired of helping me just say so and I can start a new post.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom toolbar with buttons to open new docs based on templates Default Custom Dictionary Based on Document PatrickYork Word 3 04-03-2015 11:19 PM
Dock a custom floating toolbar? itgoeson PowerPoint 0 05-25-2010 08:34 AM
Docs open under formatting toolbars clive Word 0 01-22-2010 06:26 PM
command buttons ronf Excel 0 04-28-2006 08:32 AM
command buttons ronf Excel 0 12-03-2005 06:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft