I Can't figure out how to gain access to a word document's propert

J

Jim

I'm trying to write a sub that will automatically make a copy of the active
document and save it on a network drive in a folder with the author's name.
The folders already exist on the network. But I can't figure out how to
access the document's AUTHOR field.
For brevity's sake here is the crux of my problem.
DIM strNetFile
' Creates the drive/path/filename string for the saveas statement
LET strNetFile = "G:\" & ACTIVEDOCUMENT.AUTHOR & "\" & ACTIVEDOCUMENT.NAME

ACTIVEDCUMENT.SAVE ' Saves document to user's PC
FILESAVEAS .......... ' Saves copy to network
ACTIVEDOCUMENT.CLOSE ' All done

Obviously ACTIVEDOCUMENT.AUTHOR isn't working.
Any suggestions?

BTW FILECOPY was a dead end.
When I tried to FILECOPY with the document still "active", I got an error
stating I can't copy an open file .....duh... but then when I tried to
FILECOPY with the document closed, I got an error telling I had to have the
file open????
 
H

Helmut Weber

Hi Jim,

the author:
ActiveDocument.BuiltInDocumentProperties("Author").Value

plus

Dim sfullname As String
sfullname = ActiveDocument.FullName
ActiveDocument.Save
ActiveDocument.Close
FileCopy sfullname, "c:\test\test-01.doc"

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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