Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using File - Open to get to a template in Word 2003

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
Hello

Usually when I'm working on a template letter, I get to it through Windows Explorer, then double click and it opens up a new copy.

I'm about to share this template with some others who always open their files using File - Open then navigate to the directory and then open a file. This means that with this particular template they will end up opening it up rather than running a new version.

Is there a way round this?

Pendle
 
There's no difference in those two ways of opening the file.

--
JP
 
Not true, JPaules, when you double-click a template, it opens a Word document *based* on that template. If you do file/open, it actually opens the .dot file.
 
Good point - so the question goes back to the OP: What are they supposed to do? Open the template or start a new document based on that template?

--
JP
 
Hi

The users need to start a new document based on the template and the VB then shows a form for the user to complete.

Pendle
 

Hi Pendle,

How many users are involved? Could they be trained to open the template the right way?

This issue is one of my pet peeves with Microsoft. The Word templates behave differently from the Excel templates. With Excel, it's harder to open the original template by accident (I think you have to hold down Shift or something - otherwise you get a copy).

Good luck!
GS

[small][navy]*********************
Their "fore" missed me, therefore their four-iron hit me, which is not what I was there for. It was an unfairway to start my day.[/navy][/small]
 
Hi,
You can put the template in the Users template folder. That way they can open a copy of it using File/New. On the Task Pane, click On my computer. Double click the template to open it.
HTH,


Best,
Blue Horizon [2thumbsup]
 
If you can't teach ypur users, you could rig the open procedure along these lines:

Code:
[blue]Private Sub Document_Open()
    Documents.Add Me.FullName
    Me.Close
End Sub[/blue]

You would need a bit more code to do it fully and cleanly - make sure the new document became the active one, include an escape so you could open the template yourself, make sure the template was in a trusted location so macros ran automatically, etc., etc.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
I have the user run a batch file dependant on what security group they are attached to. A part of the scripts as follows:

@echo off
copy /Y "f:\computerfiles\doc-template.dot" "%appdata%\microsoft\templates"
:: This will copy the file from the server to the Templates directory of the user
echo File Copy Completed
pause

This installs the templates to the users template directory, thus making it easier to get them to use the template. I suppose I could have it called from the login.bat but I'm a bit swamped right now learning about this company, so it takes a back seat.

Ken

"cckens is a nick... why the H-E- double-hockey-sticks am I using a nick for a name? Am I afraid of who I am?"
-me
 
So why does it need to be a .dot file?

Make it a read-only .doc file. Your VBA code can create a new document, based on a template if necessary, save the new document with a name and location of your choosing, and close the original document when it's done.

Or:

Save the .dot in each user's Word startup file and add a menu item or button to the appropriate macro.
 
Hello

Thanks for all your answers.

I can't use a batch file as I don't have permissions to do that, I work in Human Resources, not IT!!

I have tried

Private Sub Document_Open()
Documents.Add Me.FullName
Me.Close
End Sub

which works, however, I added userform.show after the me.close but this didn't trigger the form to open.

I've changed the extension to a .doc rather than .dot, but again I need to open the form and a way for me to make changes when needed.

thanks
Pendle
 
You need to load a form before you can .show it.

Load myUserForm
myUserForm.show
 
Hi

I've put

Load myUserForm
myUserForm.show

after the me.close but it's not working for me, just opens up the new version of the document.

I've also got to stay with a .dot file as it interfers with the "save as" later on - it saves the file in a certain place with the name of the person taken from the userform.

Pendle
 
is MyUserForm is in "me", and you close "me", then MyUserForm is no longer available to anything.

In fact, none of the code following me.close is available after you close me, and it simply doesn't run.

Really, the better way to do whatever it is you want to do is to have a .dot in the word startup folder. This will make any code in that .dot available always.
 
Okay thanks.

Unfortunately only IT have access to the startup folders etc, so it's impossible to do anything other than have it on the HR LAN drive which the team uses.

thanks for your efforts anyway.

Pendle
 
Pendle666,
Batch files are just simple DOS commands that are run when you call the file. In this case they only need to be run once so that the .dot file is placed in their template directory. These are not special IT priveleged files and they do nothing more than issue the commands in the file. In the case of the code I provided it copies a .dot file from a specific directory to the user's template directory requiring no special permissions except to the area the file is pulling from (this can always be altered to an open public folder on the network). If, for some reason, your IT department has limited the rights of the user to their own directory, they're shooting themselves in the foot.
This is not a wholly technical solution, and we didn't know that you were HR, but you are posting in an IT-related forum, so I provided a technical solution for template moves that works for me. If need be I can provide more explanation on what the script does. Batch file (.bat files) are useful in a number of ways that even the end user can take advantage of.
Just a little explanation... sorry if I offend...

Ken

"cckens is a nick... why the H-E- double-hockey-sticks am I using a nick for a name? Am I afraid of who I am?"
-me
 
No, no offence taken. I used to work in system support, albeit over 5 years ago now, hence why I ended up with the automation of our documents. I see what you mean with the batch file and will try this out.

thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top