Group: microsoft.public.word.vba.general
From: =?Utf-8?B?RGFycmVuIEhpbGw=?=
Date: Thursday, February 28, 2008 8:06 PM
Subject: Re: How to find MS Word's default file location

The method below is very helpful to me.
Is it possible to use have the script open the startup folder in explorer,
or paste the address into a word file which is left open? The latter option
would allow copy & paste into the explorer address bar.

Thanks,
Darren

"Karl E. Peterson" wrote:

> Karl E. Peterson wrote:
> > Southern at Heart wrote:
> >> I have a Word template to share with others. I repeatedly have to explain
> >> how they need to put it in their template folder before using it. Is there a
> >> simple way to create an .exe file that all it does check to see what the MS
> >> Word uses as the tempate folder and copys my template into it?
> >
> > Compile this in your favorite version of ClassicVB:
>
> Crud! Forgot one, teensy-weensy, *critical* detail!
>
> > Option Explicit
> >
> > Public Sub Main()
> > Dim Word As Object
> > Dim Msg As String
> >
> > On Error Resume Next
> > Set Word = CreateObject("Word.Application")
> > If Err.Number Then
> > Msg = "Word Not Installed."
> > Else
> > Msg = "Workgroup: " & Word.Options.DefaultFilePath(3) & vbCrLf & _
> > "User: " & Word.Options.DefaultFilePath(2)
> > End If
> > MsgBox Msg, , "Template Paths"
> Word.Quit '<=======================!!!!!!!!!!!!!!!!!!!!!
> > End Sub
> >
> > Or, just save this as a VBS file, and double-click it:
> >
> > Option Explicit
> >
> > Dim Word 'As Object
> > Dim Msg 'As String
> >
> > On Error Resume Next
> > Set Word = CreateObject("Word.Application")
> > If Err.Number Then
> > Msg = "Word Not Installed."
> > Else
> > Msg = "Word Template Paths" & vbCrLf & _
> > "=============================================" & vbCrLf & _
> > "Workgroup: " & Word.Options.DefaultFilePath(3) & vbCrLf & _
> > "User: " & Word.Options.DefaultFilePath(2)
> > End If
> > WScript.Echo Msg
> Word.Quit '<=======================!!!!!!!!!!!!!!!!!!!!!
>
> Otherwise, you end up with an orphaned instance of WINWORD.EXE running, and need to
> kill it using Task Manager.
> --
> ..NET: It's About Trust!
> http://vfred.mvps.org
>
>
>

Safety Articles | Usenet Groups | Usenet News | Bluegrass