Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 04-02-2023, 11:11 PM
Guessed's Avatar
Guessed Guessed is offline Save file with the name of selected text Windows 10 Save file with the name of selected text Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Doug Robbins posted a macro a long time ago that gives us the basic code which can be adapted to your requirements. I've added an arbitrary limit so your default filename doesn't get too long.
Code:
Sub FeedMeSeymour()
  Dim fd As FileDialog
  Set fd = Application.FileDialog(msoFileDialogSaveAs)
  With fd
    .InitialFileName = Left(Selection.Text, 50)
    If .Show <> 0 Then 'if the user didn't press the cancel button
      .Execute
    End If
  End With
  Set fd = Nothing
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save file with the name of selected text Footnote formatting>"Apply changes to selected text" not limiting changes to selected text Swarup Word 11 07-26-2022 01:51 PM
Save file with the name of selected text Find and Replace Selected Text or Macro for finding selected text mrplastic Word VBA 4 12-20-2019 01:25 PM
Save file with the name of selected text How do I use as Save As to take the name from a text and change the file path? rosscortb Word VBA 5 03-08-2018 04:30 AM
Save Document as Text File gerison Word VBA 5 11-27-2017 07:15 AM
Save file with the name of selected text Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft