Saving a new file - suggestion for the file-name

P

paul

When saving a new document for the first time, WORD suggest a name for the
new file

This is sometimes the first part of the first sentence in the document or
the title in Document Properties


My question is : can I compose myself that tempory name (in a VBA-code -
tempory filename = content of a bookmark) and this whitout really saving
the document.


My aim is that when users are saving the file, the dialogbox "Save" at item
"filename" suggest the name as defined in the bookmark.


thanks - paul
 
H

Helmut Weber

Hi Paul,
rather a workaround than a bulletproof solution, but anyway,
try this:
Sub FileSave()
Dim s As String
s = ActiveDocument.Bookmarks("MyMark").Range.Text
' can't think of anthing else than
If Left(ActiveDocument.Name, 8) = "Document" Then
With Dialogs(wdDialogFileSaveAs)
.Name = s
.Show
End With
End If
End Sub

Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word XP, Win 98
 

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