#1
|
|||
|
|||
Macro to open template not working
I have recorded a macro to create a new document based on a template. When I use my template without the macro it opens a new document as expected and is able to use my data source.
When I use the macro to open a new document based on my template, I get the following error: "requested object is not found" and it highlights .Destination = wdSendToNewDocument See complete macro below. Sub Petition() ' ' Petition Macro ' Macro recorded 6/16/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 ActiveDocument.SaveAs FileName:="Petition.doc", FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False End Sub Thank you. Brandi |
#2
|
|||
|
|||
change .Destination = wdSendToNewDocument
to .Destination = 0 |
#3
|
|||
|
|||
Thank you for your help. I am just getting back to this project. I have tried to change my macro to Destination = 0 and I get the same "Requested object not found"
If you are interested, I could do a GoToMeeting with you so that you can see what I am trying to do. Please let me know if you would like to do that. Thank you. Brandi |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to determine attached template | zippyaus | Word VBA | 0 | 03-02-2010 02:05 AM |
Template "File In Use" when opening 2 documents based on the same template | wendt | Word | 5 | 12-15-2009 12:37 AM |
Word field stops working on template launch | anakeimai | Word | 0 | 09-10-2009 08:49 AM |
Word 2000 Macro not working properly | brianlb | Word VBA | 1 | 07-01-2009 07:04 AM |
Word attachment on an E-mail-macro to open attachment & | nablady | Outlook | 0 | 11-28-2006 03:00 PM |