#1   Report Post  
Posted to microsoft.public.word.docmanagement
mitrebox mitrebox is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
mitrebox mitrebox is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
mitrebox mitrebox is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros in Word 2007 Technically Challenged Microsoft Word Help 4 April 4th 07 02:43 PM
Word 2007 sharing macros auto text and toolbars John Microsoft Word Help 3 February 3rd 07 01:13 PM
Word 2007 Macros Steved Microsoft Word Help 1 December 4th 06 12:07 PM
Word 2007 - how to import macros from previous normal.dot anthonycmatthews Microsoft Word Help 10 July 19th 06 10:06 PM
How to import macros in Word 2007 Joepie Microsoft Word Help 1 June 14th 06 03:20 PM


All times are GMT +1. The time now is 04:40 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"