Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
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
 



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 08:02 PM.


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