File Save As...

R

Roderick O'Regan

A template requires the following initial structure:

All pages require a header. This will be the document title.

The first page must be the TOC page with the first line being "Table
of Contents".

The next thing which should appear is the Save As... dialog box.

I have created a user form which asks for the document title and which
puts it in the header as required. OK so far.

Following this, the Save As.. dialog box appears, reading the first
line of the first page viz. Table of Contents and therefore proposes
to the user that the filename should be Table of Contents.doc

However, the users want to have in the filename field of the Save As..
dialog box the document title which went into the header.

Is there a way, please, that when the Save As.. box appears it
retrieves the title from the header and puts that into the filename
field instead of "Table of Contents" as described above?

Regards

Roderick
 
T

Tony Jollans

Use the Document's Title Property (File > Properties > Summary tab).- this
will be taken as the default Save Name if it is non-blank.

In the header put a field { DocProperty Title } - no need for code in a
UserForm to hard code the text.
 
R

Roderick O'Regan

Further to Tony's message below, it works as directed. But...

If I manually write in the document's Title property
(File>Properties>Summary tab) and then do File>Save As... it displays
the Doc Title as the default Save Name.

However, if I use VBA to complete the same exercise it does not show
the Doc Title as the default Save Name.

Why not? I don't know. But if I then go into the Doc Title field in
the Properties box and manually click at the end of the text in the
Doc Title field, then do File>Save As.. it does work correctly.

I cannot fathom out why Word is being so obtuse. Or am I...?
 
T

Tony Jollans

What fun would life be without this kind of anomaly?

I won't even try to explain it, but give this a go ...

With Dialogs(wdDialogFileSummaryInfo)
.Title = "Rabbit Stew"
.Execute
End With
Dialogs(wdDialogFileSaveAs).Show
 
R

Roderick O'Regan

Hah! Bingo! Works a treat.

Oh. And the first line of your message is pretty poetic, too!

Thanks again, Tony.
 
T

Tony Jollans

My pleasure!

--
Enjoy,
Tony


Roderick O'Regan said:
Hah! Bingo! Works a treat.

Oh. And the first line of your message is pretty poetic, too!

Thanks again, Tony.
 

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