Programmatically setting the Save As filename in a Word doc via VB6 
Author Message
 Programmatically setting the Save As filename in a Word doc via VB6

Hi All

First of all I know the SaveAs command would enable me to pre-set the
filename of a word doc, but unfortunately it will auto save it somewhere and
this won't do in my case.

A perfect solution for me is that the Word doc appears (from a word template
I have created so it's a fresh copy with a bit of dynamic data every time)
and when the user goes to File / Save or File / Save As a pre-defined
(dynamically put together) filename is already in the box so 9/10 they can
just find the location that they want to save it and click Save.

I cannot do SaveAs because the user must have the ability to go and put it
in a particular location.  Each user will definetely save it in a different
location to another user.

I have tried:

ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = "My title"

but it doesn't change the filename in the Save dialogue.

I have tried various combos using the below:

With Dialogs(wdDialogFileSummaryInfo)
    .Title = "My Title"
     .Execute
End With

For example, I tried it as is, but this just doesn't work when you run it.
I started to type oWord.Dialogs(wdDialogFileSummaryInfo), but I didn't get
.Title in the Intellisense and when I type it literally it still doesn't
work.

I've seen something called FileDialog, but when you enter the
(msoFileSaveAs).InitialFilename bit it run time errors.

Am I right in saying that what I want to do is not possible?

Has anybody found a fudge/botch/cludge to get round this?

I don't want to do SaveAs and then say to the user that by the way there
will be a million unnecessary word docs in your My Docs because I needed to
do this to pre-populate the box.

Any ideas?

Happy New Year by the way!!



Mon, 20 Jun 2011 03:06:41 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Saving Word 2000 Doc to Acrobat via VBA

2. Export Access Queries to a Word Doc via a VB6 Program

3. Using Title Doc Property As FileName When Saving Document

4. Generating HTML From a Word Doc Programmatically

5. Word objects from Acces via VB6 to WORD document

6. Data from Oracle into Word Doc via VBA

7. Manipulating Word Doc via OLE from VB

8. insert toc in word .doc via script

9. Saving oXL as new filename from Word

10. Automatically saving and setting filename

11. Word 97 save variable filename help

12. Word 97 save variable filename help

 

 
Powered by phpBB® Forum Software