Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA with MS Word help

Status
Not open for further replies.

nme187

Technical User
Apr 29, 2008
4
US
Hello everyone,

I'm trying to program an updater for my .doc in MS Word using VBA. There's 4 fields that I need to change in the .doc. 3 spots are find/replace the revision number with which ever the user inputs in a text box. There's 2 spots I'm stuck with and thats In one find/replace field the actual revision notes are entered in by a text box(the notes is usually a paragraph), well my paragraph entered in is in bold lettering which I don't know how to make it set to normal. Then the other problem is that the name of the .doc that I'm working on has the revision number in it IE: v100, well that needs to be incremented as well when the file gets revised. I can give you my code so far but it's basically just find/replace text which so far everything works.

Once this all works I still need to find a way to loop this same process through all the .doc files in the folder. Another forum pointed me in this direction to program this in VBA, if there's another way if this wont work then please let me know. Thanks.
 
Hi nme187,

It would be better to maintain the version numbers as a combination of a version number stored in a custom DocProperty value in each document and use Docproperty fields wherever required to show the current value. That way, your macro won't have to go searching for bookmarks (which are apt to be deleted) in order to updqate the version numbers - all you'd need is some basic field updating code.

Please explain a bit more about:
my paragraph entered in is in bold lettering which I don't know how to make it set to normal
Cheers

[MS MVP - Word]
 
Okay, I've fixed the bold lettering problem I had. I'm clueless on how I can get/change the files name(SaveAs new revision #) and making it do that same changes to every .doc in the folder. I'll look into DocProperty you speak of. Thanks macropod.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top