Thread: [Solved] State management?
View Single Post
 
Old 06-19-2018, 09:30 PM
Zars01 Zars01 is offline Windows 10 Office 2013
Novice
 
Join Date: Jun 2018
Posts: 3
Zars01 is on a distinguished road
Default

@macropod -

I am trying to add speed to the code I posted. Preferably with some state management ... but I'm thinking that's not a thing in Word VBA the way it is in Excel VBA.

My end game is turning this
FROM.png

into this
AFTER.png

Because
Exporting a PDF to Word mangles the tables and I want to analyze the data.
Exporting direct to Excel is worse.

My code uses tabs, tabstop position info, column widths, alignment info, etc. to determine where text is on the page.
Once that's done, I paste it to Excel then move all the text into columns according to where Word put them

@slaycock - I didn't think of that - thanks - unfortunately, the file came through with different, less workable problems? Some rows were moved to the beginning of their respective pages at random. I think this just straight up destroys the association I need

@d4okeefe - I didn't know about .ConvertToTable, so I played around with it - unfortunately, no joy.

I mean, this is the kind of thing Acrobat Pro export spits out:
Data1 tab Data4
Data1 | Data2 | Data3 | Data4

The single tab there uses a tabstop to visually move Data4 into the correct spot visually - but it isn't actually in column 4
So ConvertToTable just moved it to column 2, etc.
Reply With Quote