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

The code is mostly a series of wildcard Find/Replace operations on your data file to re-arrange the data into a series of paragraphs for insertion into the invoice file. If you comment-out the '.Close SaveChanges:=False' line, you'll be able to see exactly what it does to the data file in preparation for the insertion. The last part of the code simply tells Word where to put in paragraph from the data file into the Invoice file, using table cell addresses.

The coding is all done by hand. A recorded macro could replicate the Find/Replace part (and possibly even the transfer part), but it would be fairly verbose (full of redundant code), would create lots of screen flicker and run much slower. It also couldn't do the file selection process. The trick with the Find/Replace part, of course, is in knowing how you can use wildcards to re-arrange the data the way you want them ...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote