Link to home
Start Free TrialLog in
Avatar of Cook09
Cook09Flag for United States of America

asked on

VBA Sub to add, to each line, in a Word 2010 Document

I would like to be to have, in an active document, a statement added at the beginining of every line, regardless of whether there are Tabs or spaces. Then at the end of each line, deleting a "," adding a space, and then adding a ' " '.

Example:
Original:
SCOLOAN.SEGMENT as SEGMENT_ID,
Desired:
sQuery = sQuery & ", SCOLOAN.SEGMENT as SEGMENT_ID  "
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cook09

ASKER

Attached is a file that has the recommendations performed.  The other aspect is that this could be performed on serveral queries over time, and something a liitle automated might be better, given how this turned out.  The format is at it is to be sent the SQL Server, or very close to it, I just changed the names.  

Below the end result, is a copy of the raw data in which I stripped a lot, but not all, of the nonprintable characters from the beginning.
QueryFormatting.docx
Avatar of Cook09

ASKER

Come to find out, after the others, that I must have done something incorrect with this one, because it does work.  Should have done more beta with it.