[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Save word document as docx from user form - want user to be able to browse for file location

Posted on 2016-07-14
3
Medium Priority
?
97 Views
Last Modified: 2016-07-18
Hi Experts,

I'm creating a word macro enabled document (docm) that I want the user to be able to save as a word document (docx) by pressing a button (savecmd) in a userform (saveform). I've got a text box on the form (FileNametxt) where I want them to be able to write the name of the file name that the document will be saved as.

I'd also like to add a feature so they can browse for the best file location where the file will be saved.

Any advice on how I can do this?

Thanks in advance for your help
0
Comment
Question by:martywal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 41710633
Hi,

why not

Sub SaveMe()
    Set dlgSaveAs = Dialogs(wdDialogFileSaveAs)
    With dlgSaveAs
        .Name = "myDocument" ' suggested name
        .Format = wdFormatXMLDocument
        .Show
    End With
End Sub

Open in new window

0
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 41710658
to force docx then use

Sub SaveMeAsDocx()

With Dialogs(wdDialogFileSaveAs)
.Format = wdFormatXMLDocument
If .Display = 0 Then Exit Sub
If .Format = wdFormatXMLDocument Then
    .Execute
Else
   MsgBox ("You are only allowed to save in docx format.  Please try again")
   Call SaveMeAsDocx
End If
End With

Open in new window

0
 

Author Closing Comment

by:martywal
ID: 41718157
Thanks Rgonzo1971, that did just as I was after. Vey helpful! Thx
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Suggested Courses

656 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