Word File save as

Dear Experts,

Utilising word 2010 - Courtesy of EE, I have a macro-enabled word doc that allows users to fill out a series of questions in a form, the answers are then populated throughout the document.

What I would like to do is bring up a file save as dialog box to save the end result as a .doc &  also close down the original macro-enabled word doc without saving changes.

Can anybody help?
correlateAsked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
Perhaps that is because the macro uses Document_Open instead of Document_New. You indicate that the macro came from this forum. Can you post a link to it, please?
0
 
GrahamSkanRetiredCommented:
This would save the active document
Sub MySave()
    Dim dlg As Dialog
    Set dlg = Dialogs(wdDialogFileSaveAs)
    dlg.Show
End Sub

Open in new window

However it isn't clear why you have two document to consider.

It is normal to use a template to create a new document via File/New. The template is not usually opened as a document, and doesn't need to be closed.
0
 
correlateAuthor Commented:
The reason for this is that the code to produce the form for users to fill in resides in document and when I use it as a macro enabled template the form doesn't open automatically and also I get the yellow security warning saying the macros have been disabled.

I tried the code & it brings up the save as dialog all ok, but when I click on save it just keeps popping up again - how can i turn it off once I have clicked save.

Also is there a way to set the save as a plain .docx rather than a macro enabled doc?

Many thanks
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
GrahamSkanRetiredCommented:
I guess that you have picked out some bits from this question.
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/Q_27988350.html
Can you show which bits, please?
0
 
correlateAuthor Commented:
Alas i'm away from my pc for tonight - I'll change the auto open to new & hopefully that should crack it

Many thanks for your help on this one
0
 
GrahamSkanRetiredCommented:
If there is only one document open, it will be the ActiveDocument.If there are more and you need code to treat documents differently, there has to be a way to distinguish between them.
0
 
correlateAuthor Commented:
Did the job perfectly - thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.