MS word save as question

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi all

This is a long shot and i never use word and now i could do with a macro to come to my rescue :-D

In excel i know its possible to save a workbook as a cell value, something like
Code:
Sub SaveAsA1()
    ThisFile = Range("A1").Value
    ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

Anyway due to a recent failed audit i now have to save all word docs in a set format: Like author published date review date.doc

Author/Published and review date are always in the same place on each doc, so my question is does anyone know if there is a macro which can save word docs based on content:

Thisworddoc.saveas filename: Page1 column one blah blah....?

Any help greatly apppreciated i have hundreds of docs to change file name. Any excel solutions perhaps also greatly welcome :-D

Perhaps its not possible....?

Thanks for any input!!!!
 
Would it be possible for you to type the name of the file on the first line, make the text white, and let Word save it as it would normally with the first line?
You could format the text to 4 points so it wouldn't take up much space but you cannot make it hidden b/c Word will not pick it up for the name.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you want to hide something from normal view, embedding it in a SET field in the header/footer area work well. For example, a SET field coded as {SET BkMrk "This is my story"} will create a bookmark (named 'BkMrk') holding the string "This is my story", which won't normally appear but can be accessed vi a REF field or via vba.

Cheers
 
Upvote 0
coachdaley,

Good idea something i hadnt thought of and probably should of!
My problem with this is i have piles of word docs to go through so id still have the issue of opening each word doc typing the file name and an so on.

Im just about getting to grips with making bookmarks and doing a save as using those. If that fails ill go back to using the built in document properties to capture what i need. Can i combine the 2?

Any view on whether or not i can combine the 2 together document properties and boomarks in the save as routine?

The built in properties wont have my document name in so i would need to use the bookmark route...

Is using one method advantageous over the other? I assume using the bult in doc properties would be the best bet?

Thanks all
 
Upvote 0
Hi Adam,

Word has a built-in file-name field you could use but, if you're going to be adding the details you suggested whenever you save the document, the filename will get longer with each save.

The problem with hidden text (and I include white text on a white background in that) and bookmarks is that they're all to easy for someone to delete by accident.

However, if you check under File|properties, you'll see a number of fields that you can add data to, including 'Title', 'Subject' and so on. These are much less likely to be ruined by someone working on the document, since they're not normall seen. You could use one of these as your document 'key' and include that as part of the filename created by code like that which I posted. Quite easy to do.

Cheers
 
Upvote 0
Macropod

Thanks,

i scrapped the bookmark idea and used the built in doc properties also, purely because once i put the code together it was going to be used ny lots of unskilled users in the same way. the bookmark route was causing me all sorts of emails "This doesnt work" etc etc i think it did work but like you say fields can easily be moved deleted.

I simply set up the template to prompt the document properties. and hey presto it works.

Thanks for all the input from everyone, ive learnt alot!
 
Upvote 0

Forum statistics

Threads
1,225,358
Messages
6,184,497
Members
453,236
Latest member
Siams

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top