Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word 2007 Macros
I am trying to record a macro in Word 2007 that retreives a template as a new
document. For some reason, I can only get the macro to get the template as a template. I don't know what I'm missing. Please help. Thanks. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word 2007 Macros
On Fri, 13 Apr 2007 14:52:02 -0700, mitrebox
wrote: I am trying to record a macro in Word 2007 that retreives a template as a new document. For some reason, I can only get the macro to get the template as a template. I don't know what I'm missing. Please help. Thanks. I bet you're recording the use of the Open dialog. You should be using the New dialog. If you do that, the macro should contain a statement like this (but containing the name of the template you chose): Documents.Add Template:= _ "C:\somePath\someTemplate.dotx" _ , NewTemplate:=False, DocumentType:=0 It should _not_ contain a Documents.Open statement, which is what you're getting now. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word 2007 Macros
"Jay Freedman" wrote: On Fri, 13 Apr 2007 14:52:02 -0700, mitrebox wrote: I am trying to record a macro in Word 2007 that retreives a template as a new document. For some reason, I can only get the macro to get the template as a template. I don't know what I'm missing. Please help. Thanks. I bet you're recording the use of the Open dialog. You should be using the New dialog. If you do that, the macro should contain a statement like this (but containing the name of the template you chose): Documents.Add Template:= _ "C:\somePath\someTemplate.dotx" _ , NewTemplate:=False, DocumentType:=0 It should _not_ contain a Documents.Open statement, which is what you're getting now. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Thanks for your reply -- the templates that I'm using were all are *.dot. Should that matter? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word 2007 Macros
"Jay Freedman" wrote: On Fri, 13 Apr 2007 14:52:02 -0700, mitrebox wrote: I am trying to record a macro in Word 2007 that retreives a template as a new document. For some reason, I can only get the macro to get the template as a template. I don't know what I'm missing. Please help. Thanks. I bet you're recording the use of the Open dialog. You should be using the New dialog. If you do that, the macro should contain a statement like this (but containing the name of the template you chose): Documents.Add Template:= _ "C:\somePath\someTemplate.dotx" _ , NewTemplate:=False, DocumentType:=0 It should _not_ contain a Documents.Open statement, which is what you're getting now. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. This is the syntax: Sub GetLH() ' ' GetLH Macro ' ' ChangeFileOpenDirectory "C:\WINWORD\TEMPLATE\" Documents.Open FileName:="KohnLH.dot", ConfirmConversions:=True, ReadOnly _ :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _ :="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _ , Format:=wdOpenFormatAuto, XMLTransform:="" Selection.MoveDown Unit:=wdLine, Count:=4 End Sub I don't know what to do -- |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word 2007 Macros
On Fri, 13 Apr 2007 18:42:02 -0700, mitrebox
wrote: "Jay Freedman" wrote: On Fri, 13 Apr 2007 14:52:02 -0700, mitrebox wrote: I am trying to record a macro in Word 2007 that retreives a template as a new document. For some reason, I can only get the macro to get the template as a template. I don't know what I'm missing. Please help. Thanks. I bet you're recording the use of the Open dialog. You should be using the New dialog. If you do that, the macro should contain a statement like this (but containing the name of the template you chose): Documents.Add Template:= _ "C:\somePath\someTemplate.dotx" _ , NewTemplate:=False, DocumentType:=0 It should _not_ contain a Documents.Open statement, which is what you're getting now. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. This is the syntax: Sub GetLH() ' ' GetLH Macro ' ' ChangeFileOpenDirectory "C:\WINWORD\TEMPLATE\" Documents.Open FileName:="KohnLH.dot", ConfirmConversions:=True, ReadOnly _ :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _ :="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _ , Format:=wdOpenFormatAuto, XMLTransform:="" Selection.MoveDown Unit:=wdLine, Count:=4 End Sub I don't know what to do -- Delete the macro you have, since it doesn't do what you want. (In the macro editor, just highlight all the code you showed above, and press the Delete key.) Start the macro recorder again. Click the Office button and choose the item at the top of the menu, New, instead of the Open item. If you see the KohnLH.dot template in the dialog, click it and click the Create button. If you don't see that template in the dialog, click the "My templates" choice in the list on the left side to get another dialog. Choose the KohnLH.dot template in this dialog, and click the OK button. Stop the recorder. Try running the macro; it should make another new document based on the same template. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macros in Word 2007 | Microsoft Word Help | |||
Word 2007 sharing macros auto text and toolbars | Microsoft Word Help | |||
Word 2007 Macros | Microsoft Word Help | |||
Word 2007 - how to import macros from previous normal.dot | Microsoft Word Help | |||
How to import macros in Word 2007 | Microsoft Word Help |