Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2011, 08:24 AM
xscotsmanx xscotsmanx is offline Default Save AS File Name from Bookmark Windows 7 64bit Default Save AS File Name from Bookmark Office 2007
Novice
Default Save AS File Name from Bookmark
 
Join Date: Jul 2011
Posts: 1
xscotsmanx is on a distinguished road
Default Default Save AS File Name from Bookmark

Hi all,

I am fairly new to VBA but have made some userform letter precedents etc.

I save all my letters with a specific number, so for example L1234. My userform already fills a bookmark with the required letter number.

My question is can I have that letter number be the default file name when I open the save as dialogue to save the document?

If so can anyone help as to how I go about it? I have spent hours trying to figure it out.
Reply With Quote
  #2  
Old 07-17-2011, 12:23 AM
macropod's Avatar
macropod macropod is offline Default Save AS File Name from Bookmark Windows 7 64bit Default Save AS File Name from Bookmark Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi xscotsmanx,

Try something based on:
Code:
Sub Demo()
With ActiveDocument
  .SaveAs FileName:=.Bookmarks("BookmarkName").Range.Text & ".docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False 
End With
End Sub
This automatically saves the file with the Bookmark Name, without going through the dialogue. To use the SaveAs dialogue, you could use something based on:
Code:
Sub Demo()
With Application.Dialogs(wdDialogFileSaveAs)
  .Name = ActiveDocument.Bookmarks("BookmarkName").Range.Text
  .Show
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Save AS File Name from Bookmark error: You are attempting to save a file format that is blocked by file block setting zatlas1 Office 8 04-28-2012 02:37 PM
Default Save AS File Name from Bookmark [Word 2007] How to hyperlink directly another word file chapter/paragraph/bookmark? LeeFX Word 4 05-05-2011 05:53 PM
Does not SAVE AS to default folder pleveque Office 0 01-13-2011 08:34 AM
Default Save AS File Name from Bookmark Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM
How to save file on CD? DennisWG Word 0 09-07-2010 10:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:03 AM.


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