PDA

View Full Version : Solved: Name Document1 on Opening



geedee65
09-24-2007, 08:13 AM
When I open a new document from a template, it names it document1, document2, etc.

Is it possible to give it the name of the template + Format(now,"yymmdd"), without saving it first?

This is because the form is emailed as an attachment for approval before saving to the corporate server and as an added complication, no documents are allowed to be saved on a local drive (eg My Documents).

fumei
09-24-2007, 08:22 AM
Not that I know of. At least not easily. And not by using the native Send To function. You would have to write an Outlook procedure, and even then....I don't know if you can give it a name. Maybe, I have never tried to do this.

Document1 is a temp name.

TonyJollans
09-24-2007, 10:03 AM
You cannot give a document a name without saving it.

When you e-mail it as an attachment, it is first saved in a temporary location either with its name (if it has previously been saved and has one) or with its default name.

Unfortunately, when saving a temporary copy of an unsaved document for e-mailing, Word uses its built-in default name rather than anything based on user input, so the only way you can achieve what you want is by doing your own save to a temporary location first of all.

I don't know whether you will be able to do this if saving is not allowed on local drives.

geedee65
09-25-2007, 03:21 PM
Looks like I am going to have to work around this one in the email procedure, unfortunately we use Lotus Notes and not Outlook!

fumei
09-26-2007, 01:34 PM
Methinks you are stuck if you can not save the file.

BTW: I believe what you see as "Document1" does not exist as a file.

Even if you DO use Outlook, and DO send the existing active window - ie. "Document1" - it is NOT sent as such. I just did it.

It is sent as "Doc1.Doc".

Further, even though the received email message shows a "Doc1.doc" (and the "file size" in Kb), the file itself still does not exist. You can search and search for it. It is not to be found. If you open the file from the email message - not saving it to disk, but opening it from the email - then a shortcut is created.

If you check the properties of the shortcut, it states the target file is in Temporary Internet Files\ OLKxxxxx.

This is where OUTLOOK holds, and stores, file attachments that are opened from within an email. By opening an attachment from an email message you CREATE a file in the temp OLKxxxx folder.

This folder is not cleaned properly by Windows.

TonyJollans
09-26-2007, 10:07 PM
Hmmm..

This may depend on e-mail client and/or version, I'm not sure, but before attaching to an e-mail, the file is saved to a temporary location (folder OLK whatever) as Doc1.Doc (assuming it was Document1) - the Doc1 bit is Word's fallback name - it does not use the Title or document content in the way a normal Save does.

When you open it from the e-mail it is again copied (from within the e-mail) to a temporary location (on the recipient's computer) from where it is actually opened. I'm not sure what you mean about shortcuts.

I also don't know what you mean about not being cleaned by Windows - it is an Outlook folder and should be cleaned by Outlook.

geedee65,

Despite your bar on saving to local disk, e-mailing it does cause such a save. Could you perhaps first save it to somewhere like %Temp%?

geedee65
09-27-2007, 05:07 AM
Of course ..... the temporary folder!!
Lotus Notes is the same as Outlook in that respect, it saves the attachments to a tempoaray folder.

All I have to do is have the username as a variable in the filepath when saving the file.
Name the file as required when doing the 'Save As'.
Then attach and send.

Thanks Gerry & Tony.

fumei
09-29-2007, 01:09 AM
No Tony, it is not an Outlook folder. OLKxxxx is a Windows folder, just like any other Windows folder (although it is a Hidden folder). Sometimes it is cleaned properly, and sometimes it is not. Yes, this depends on version.

TonyJollans
09-29-2007, 05:56 AM
OK - technically you are correct. :)

What I meant was that it is created by Outlook - somewhere deep within the Temporary Internet Files Folder. Although hosted by Windows, Windows (unless you consider IE a component of Windows) has nothing to do with it otherwise.

It is my understanding that Outlook deletes temporary OLK... folders at the end of the Outlook session if not before. In the case of a crash, it may be that some are left lying around and there may then be no automatic housekeeping that deals with them.

It is possible that orphaned folders lie around until manually removed -that is what happens with all other temporary files. There is little (if any) housekeeping of this sort performed by Windows; whether there should be is a whole different question.