Solved

Word File save as

Posted on 2013-01-09
7
405 Views
Last Modified: 2013-01-10
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?
0
Comment
Question by:correlate
  • 4
  • 3
7 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38759688
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
 

Author Comment

by:correlate
ID: 38759754
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
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 38759952
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38760000
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
 

Author Comment

by:correlate
ID: 38760029
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38760184
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
 

Author Closing Comment

by:correlate
ID: 38762136
Did the job perfectly - thank you
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now