View Single Post
 
Old 07-06-2014, 03:25 AM
macropod's Avatar
macropod macropod is online now Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
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

Re 1: That depends on what determines the required instant. As coded, the macro runs to completion when the document is created. Depending on what you want to do between opening and saving the document, it might be possible to solicit any required inputs via an InputBox, or two, for example, or by working with other dialogues. That way, the macro merely suspends processing while waiting for the required inputs.

Re 2: I don't see what the issue is. Since you're populating the title with the contents of the StrNm variable, there is no reason to not continue using it for whatever else it might be useful for. That said, if you're desperate to refer to the title property, you could use:
.Name = ActiveDocument.BuiltInDocumentProperties("Title")

Re: 3: The layout looks fine, though I'd be inclined to indent the .BuiltInDocumentProperties references so the nesting of the structure remains more apparent. The main point in using such visible structuring is for ease of maintenance. FWIW, though, VBA really doesn't care how the code looks - it's the logical structure that matters. Also, rather than creating and using 'DocSubject' for a once-off use, I'd be inclined to use:
.BuiltInDocumentProperties("Subject") = .Bookmarks("doctype").Range.Text
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote