Can some one prrovide the proper VBA to be able to SaveAs the ActiveDocument using a filename from text previously set as a BookMark.
Regards,
Tom54
Word VBA Saving File Using Bookmark
-
- Administrator
- Posts: 78412
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Word VBA Saving File Using Bookmark
ActiveDocument.SaveAs FileName:=ActiveDocument.Bookmarks("MyBookmark").Range.Text
This will save the document in whatever is the current folder for Word (if you haven't set it explicitly, it'll be the default document folder).
If you want to save in a specific folder:
ActiveDocument.SaveAs FileName:="C:\MyFolder\" & ActiveDocument.Bookmarks("MyBookmark").Range.Text
This will save the document in whatever is the current folder for Word (if you haven't set it explicitly, it'll be the default document folder).
If you want to save in a specific folder:
ActiveDocument.SaveAs FileName:="C:\MyFolder\" & ActiveDocument.Bookmarks("MyBookmark").Range.Text
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 26
- Joined: 15 Feb 2010, 18:04
Re: Word VBA Saving File Using Bookmark
Hans:
Thank you! Just what I needed.
This will greatly help in project I am currently working on.
Regards,
Tom54
Thank you! Just what I needed.
This will greatly help in project I am currently working on.
Regards,
Tom54