#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 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] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
[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 |
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 |