Automatically putting templates from a CD to Hard Drive 
Author Message
 Automatically putting templates from a CD to Hard Drive

Some time ago I asked how it would be possible to copy some templates I have
onto the hard drive where the other templates are stored. The templates need
to be distributed onto stand alone pcs.
I had a number of responses, for which many thanks.

Someone said that it is possible to create a read-me.doc with a macro button
to do the copying for me. Having tried to write the code, bearing in mind I
am a newbie, I have been unsuccessful. some kind person said that if I
posted to this group they would give me some assistance. Hence this message.
If anyone can help with the code I would be really grateful.

Many thanks in anticipation.



Sun, 17 Oct 2004 14:55:52 GMT  
 Automatically putting templates from a CD to Hard Drive
Hi Ian,

The thing you need to know is

1. Where are the templates now?
2. Where do they have to be copied to?

Since the document will be on a CD drive, you will already know where on the
CD the templates are, so getting the full path of the templates is simply a
matter of knowing the CD's drive letter.

The following line of code will place the drive letter of the CD drive into
a string variable

strSourceDrive = Left$(ActiveDocument.FullName, 1)

This assumes that the macro called from a MACROBUTTON field in the
read-me.doc on the CD drive. With the drive letter, and your knowledge of
where on the CD you are placing the templates, there should be no problem
identifying the full pathname of each one.

To find where the templates should go, you need one of the properties of the
Options object. I assume that you want to copy the templates into the User
templates folder so that they are visible when the user does a File New
command. The following line of code will give you that path.

strDestFolder = Options.DefaultFilePath(wdUserTemplatesPath)

Once you have the source and destination folders, then it should be fairly
straightforward to use the FileCopy command to copy the templates to the
destination folder.

Finally once you are sure your macro is working, you need to include a
MACROBUTTON field in the readme file. The needs to be like this.

{ MACROBUTTON MacroName Double-click here to install templates }

The {} characters are field braces inserted by pressing Ctrl-F9.
MacroName should be changed to whatever name you give the macro.
The remaining text will be visible, and can be changed to whatever you want.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Some time ago I asked how it would be possible to copy some templates I
have
> onto the hard drive where the other templates are stored. The templates
need
> to be distributed onto stand alone pcs.
> I had a number of responses, for which many thanks.

> Someone said that it is possible to create a read-me.doc with a macro
button
> to do the copying for me. Having tried to write the code, bearing in mind
I
> am a newbie, I have been unsuccessful. some kind person said that if I
> posted to this group they would give me some assistance. Hence this
message.
> If anyone can help with the code I would be really grateful.

> Many thanks in anticipation.



Sun, 17 Oct 2004 17:35:31 GMT  
 Automatically putting templates from a CD to Hard Drive
Thanks for your help Jonathan

It is appreciated


Quote:
> Some time ago I asked how it would be possible to copy some templates I
have
> onto the hard drive where the other templates are stored. The templates
need
> to be distributed onto stand alone pcs.
> I had a number of responses, for which many thanks.

> Someone said that it is possible to create a read-me.doc with a macro
button
> to do the copying for me. Having tried to write the code, bearing in mind
I
> am a newbie, I have been unsuccessful. some kind person said that if I
> posted to this group they would give me some assistance. Hence this
message.
> If anyone can help with the code I would be really grateful.

> Many thanks in anticipation.



Mon, 18 Oct 2004 16:50:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help needed reading database on CD and writing to database on hard drive

2. ShellExecute works on hard drive but not on CD-ROM

3. How to read the hard drives drive no.

4. Insert records from a database in floppy drive to hard drive

5. Hard Drive Serial Number/Total Drive Size

6. check is there a CD ROM in the CD drive

7. Eject CD in case of 2 CD drives

8. EJECT CD from CD Drive ???

9. Use 2nd CD-ROM drive to play CD Audio

10. Checking Whether Drive is a CD ROM Drive

11. Retrieving drive letter for user's cd-rom drive

12. How to determine if a drive is a CD-ROM drive

 

 
Powered by phpBB® Forum Software