05-21-2004, 09:50 AM
I am writing a program that reformats an HTML table inside of MS Word. As of now, the program runs extremely slow using the selection object. I assume that the range object would be a better idea, but I don't know where to begin and if it is worth the time. Additionally, if the range object or selection object is not the way to go about speeding things up, please point me in that direction.
05-21-2004, 03:21 PM
Can you give us a bit more background on what you're doing? Could you post your current code? (Using the [vb] or [code] tags to format it - or attach a file if there's lots of code.)
05-24-2004, 07:19 AM
I attached a copy of my function. The more I look at it, I think I would be better off with a for each... loop.
As for background ... I am converting a VB6 program that I did not write to .NET. I was able to write all the code besides the function I am sending along with the functions from calls inside of it. I wasn't sure what was going on with the table manipulation, so I just went into the code and changed things here and there. I do apologize that it isn't the easiest thing to read, but I am still working on the readability.
Let me know if there is anything else that would be helpful.
05-25-2004, 07:45 PM
OK, that's a lot of code, more than I have time to read and understand at the moment - especially since I'm not a Word expert. Sorry.
Which parts should I look at? And what exactly is the code doing - what kind of reformatting?
If this is a html document, is there a particular reason why you're doing this in Word instead of editing the html source?
05-26-2004, 11:34 AM
I found a bit of resolve for my issue ... instead of the do until loop I had, I changed the code to use a fer each loop. I do not know if this was the best way, but it is quicker than before.
About the having to be in Word, yes, unfortunately. I would have liked to do everything outside of Word as possible since Word is a little resource hungry, but the HTML is created from an SGML file that goes through an Omnimark filter. To change a colwidth in an HTML table is much easier than the background work I would have to do with the inept DTD the SGML has to follow.
Thanks for all the help