Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2003: open with repair option - VB hangs

Status
Not open for further replies.

MakeItSo

Programmer
Oct 21, 2003
3,316
0
0
DE
Hello friends,

I am just working on a tool that will process batches of Word documents.
In order to secure correct processing, I want to first open each document in Word 2003 with "Open and repair", and replace the attached template with "Normal.dot".

Strangely, it will not function. VB (or probably rather Word) hangs on execution of the bolded line:
Code:
[b]Set doc = wrd.Documents.Open(FileName:=TheFile, OpenAndRepair:=True)[/b]
                doc.AttachedTemplate = "Normal"
                doc.Close SaveChanges:=True

I have pre-checked, that the Word application is being initiated and that the version of the Word instance is 11.

Can you tell me what I'm doing wrong?

Thanks!
Andy

[blue]Help us, join us, participate
IAHRA - International Alliance of Human Rights Advocates[/blue]
 
Fixed!!!

I finally found a KB article (Wow, they're still occasionally writing functioning KB articles??), which describes the problem and the fix.

Here's the link:

And here's the fix (excerpt):

...the Show Repairs dialog box does not have an option to prevent the dialog box from appearing when you open a damaged document in the future. [rem: that is why VB hangs here: it is waiting for the dialog to be confirmed]
...
This issue is fixed in the Word 2003 post-Service Pack 2 Hotfix Package that is dated November 10, 2005.
...
To enable this hotfix, follow these steps:
1. Quit Word 2003.
2. Click Start, click Run, type regedit, and then click OK.
3. Locate and then click to select the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options
4. After you select the key that is specified in step 3, point to New on the Edit menu, and then click DWORD Value.
5. Type BulletProofOnCorruption, and then press ENTER.
6. Right-click BulletProofOnCorruption, and then click Modify.
7. In the Value data box, type 1, and then click OK.
8. On the File menu, click Exit to quit Registry Editor.

Hope this will help others in future!
:)

Cheerio!
Andy

[blue]Help us, join us, participate
IAHRA - International Alliance of Human Rights Advocates[/blue]
 
>Wow, they're still occasionally writing functioning KB articles??

Sure. Mainstream support for Word 2003 doesn't end until 13 Jan 2009.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top