Group: microsoft.public.word.vba.general
From: =?Utf-8?B?R2FyeSBP?=
Date: Friday, March 14, 2008 3:34 PM
Subject: Re: Deleting part of a string



"Doug Robbins - Word MVP" wrote:

> Rather than trying to automate this process when a new document is being
> created from your normal.dot template, you should create a new template that
> contains the required information in its footer.
>
> For the date use a { CreateDate } field for the page number use a { Page }
> field. For the modified path\filename, insert a { DOCVARIABLE
> varPathFilename } field and use the following code the set that variable and
> display the result in the docvariable field
>
> Dim fpath As String
> Dim strTemp() As String
> With ActiveDocument
> fpath = .FullName
> strTemp = Split(fpath, "\")
> fpath = strTemp(UBound(strTemp) - 1) & "." _
> & strTemp(UBound(strTemp))
> .Variables("varPathFilename").Value = fpath
> .PrintPreview
> .ClosePrintPreview
> End Sub
>
> Have that code in macros created in that template with the names of
>
> FileSave
> FileSaveAs
> FilePrint
> FilePrintDefault
>
> or have it in a separate routine which you call for each of the above named
> macros.
>
> The other things can all be done, but how is the "specifying" going to be
> done.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP

Doug,

I believe what you've suggested is exactly what I was after. When I go back
to work after the weekend I'll implement what you've suggested and advise how
it is working.

Regards


Gary O

Safety Articles | Usenet Groups | Usenet News | Bluegrass