Click here to Skip to main content
15,898,945 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Replacing Bytes in an Office 2003 Word Document Pin
Richard MacCutchan14-Dec-09 5:05
mveRichard MacCutchan14-Dec-09 5:05 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
jonegerton14-Dec-09 6:32
jonegerton14-Dec-09 6:32 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
The Man from U.N.C.L.E.14-Dec-09 7:33
The Man from U.N.C.L.E.14-Dec-09 7:33 
AnswerRe: Replacing Bytes in an Office 2003 Word Document Pin
Eddy Vluggen14-Dec-09 5:50
professionalEddy Vluggen14-Dec-09 5:50 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
Luc Pattyn14-Dec-09 6:21
sitebuilderLuc Pattyn14-Dec-09 6:21 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
Eddy Vluggen14-Dec-09 7:16
professionalEddy Vluggen14-Dec-09 7:16 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
jonegerton14-Dec-09 6:35
jonegerton14-Dec-09 6:35 
GeneralRe: Replacing Bytes in an Office 2003 Word Document Pin
Member 368078514-Dec-09 8:54
Member 368078514-Dec-09 8:54 
jonegerton wrote:
Unfortunately this has to work on thousands of documents (corporate rebrand!)



So I guess you have been tasked with replacing all occurences of "Tiger Woods" with "Tom Watson" or something along those lines?

I tried to make something like that work years ago, i.e. something that tried to re-create the Word "save" logic at a low level. My recollection is that somewhere in the file, there is a field holding the length of the data or (less likely) a checksum. I thought I was adjusting that properly, but never did manage to create "valid" Word documents. Apparently there was some other checksum somewhere that I did not know about. Eventually I ended up doing the job with automation. I managed to work through the message-box-related issues... I think there are ways to detect the error condition and kill Winword.exe. In the worst case, you could just assume an error occured after a certain length of time.

None of this is beautiful, but in the end it proved more workable than manually messing around with the file. And I did try mightily to make that work... I was just out of college, and had been immersed in a thesis that used Intel assembly, and the low-level approach was definitely the one I preferred.

One more thought: the "DOCX" format of Office 2007 is much more regular and well-documented than the old melange of DOC formats. I think a DOCX is basically a zipped-up collection of XML documents and embedded image files. Have you considered converting to DOCX as the first step of the process? It might make your life easier.
QuestionFind out encoding of any file [modified] Pin
jonegerton14-Dec-09 3:08
jonegerton14-Dec-09 3:08 
AnswerRe: Find out encoding of any file Pin
Richard MacCutchan14-Dec-09 5:06
mveRichard MacCutchan14-Dec-09 5:06 
QuestionHow to auto expand combo box on focus. [modified] Pin
Mithun.Shitole13-Dec-09 23:05
Mithun.Shitole13-Dec-09 23:05 
GeneralIssue when create popup calendar.... Pin
Golden Jing13-Dec-09 14:49
Golden Jing13-Dec-09 14:49 
GeneralRe: Issue when create popup calendar.... Pin
EliottA14-Dec-09 3:34
EliottA14-Dec-09 3:34 
GeneralRe: Issue when create popup calendar.... Pin
Golden Jing14-Dec-09 20:07
Golden Jing14-Dec-09 20:07 
GeneralRe: Issue when create popup calendar.... Pin
EliottA15-Dec-09 3:25
EliottA15-Dec-09 3:25 
QuestionVB Form Commands in TextBoxes Pin
Dimz9313-Dec-09 4:10
Dimz9313-Dec-09 4:10 
AnswerRe: VB Form Commands in TextBoxes Pin
EliottA13-Dec-09 17:25
EliottA13-Dec-09 17:25 
AnswerRe: VB Form Commands in TextBoxes Pin
Eddy Vluggen14-Dec-09 0:59
professionalEddy Vluggen14-Dec-09 0:59 
QuestionNo Connection? Pin
teknozwizard12-Dec-09 21:25
teknozwizard12-Dec-09 21:25 
QuestionHelp with VB 2008.NET, Please [modified] PinPopular
treashunter10-Dec-09 20:21
treashunter10-Dec-09 20:21 
AnswerRe: Help with VB 2008.NET, Please Pin
Johan Hakkesteegt10-Dec-09 22:27
Johan Hakkesteegt10-Dec-09 22:27 
GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 22:36
treashunter10-Dec-09 22:36 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:42
professionalTom Deketelaere10-Dec-09 23:42 
GeneralRe: Help with VB 2008.NET, Please Pin
treashunter10-Dec-09 23:49
treashunter10-Dec-09 23:49 
GeneralRe: Help with VB 2008.NET, Please Pin
Tom Deketelaere10-Dec-09 23:57
professionalTom Deketelaere10-Dec-09 23:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.