Macro runtime error

J

JimmyFromScotland

I have set up a macro using the recording wizard to open a file which i use
often as a template. Now when i click on the macro button, Run-time Error
5174 keeps coming up.

Can anyone help?

Thanks
 
G

Graham Mayor

It would have helped had you posted the code :(
However the simplest way to access a regularly used file is to add it to the
Work menu.
If you are using it as a template - save it as a template and create new
documents from it. That will save you from coming back later to say that you
have overwritten it.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

It would have helped had you posted the code :(
However the simplest way to access a regularly used file is to add it to the
Work menu.
If you are using it as a template - save it as a template and create new
documents from it. That will save you from coming back later to say that you
have overwritten it.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

How did that happen :( The PC must have hiccups

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

JimmyFromScotland

LMAO

Here's the code (sorry, i may have posted this on the wrong board, but here
goes):

Documents.Open FileName:="""Envelope template.doc""", ConfirmConversions:= _
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""

Thanks
 
G

Graham Mayor

You only need this bit - where 'path' is the path to the document

Documents.Open FileName:="""c:\path\Envelope template.doc"""

However, I repeat that saving the document as a template or the Work menu
are much the better options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top