Thread: [Solved] Inserting a Backspace
View Single Post
 
Old 03-22-2013, 09:49 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

Hi Swerv,

Try the following version of your invoice document. It contains a macro named 'MakeInvoice' that lets you pick the data file. When you do that, the (modified) table is populated directly, without recourse to the textbox you used. Amongst other things, this frees you up to format the various parts of the invoice differently. to run the macro, press Alt-F8, then double-click on 'MakeInvoice'.

At the moment, the macro populates the document, which kind of complicates things a bit if you accidentally save it with a populated invoice. The macro will overwrite the data next time around, but IMHO it's better to start off with a blank document each time. Accordingly, if you change the macro's name to 'Document_New' and save the file as a Word template (ie with a .dot extension), it will create a new document each time you double-click on it and automatically prompt you for the data file.
Attached Files
File Type: doc Invoice.doc (52.0 KB, 16 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote