index > Visual Basic for Applications (VBA) > Problem automatic opening of .doc's with WebTools elements fails

Problem automatic opening of .doc's with WebTools elements fails


Hi Folks ...

Ok, opening a .doc file with a button and converting it to rtf ist simple. But currently I'm facing a very interesting problem.

I use a VBA Script to open a specific .doc file on my local hd.
This works fine, but when this document contains for example an input field (from the WebTools) the following code fails without an error message (or better with an empty vba error box) on the documents.open(.. line.

Dim wordApp As Word.Application
Set wordApp = New Word.Application
wordApp.Visible = True
Dim wordDoc As Word.Document
Set wordDoc = wordApp.Documents.Open("c:\test\MyDoc.doc", _
AddToRecentFiles:=False, Format:=wdOpenFormatAuto)
...

The problem occurs on Office XP and 2003.
Any ideas?




NetDiver
Ok, some more information. It seems that not the webtools are the reason for the error. It more a link in to an unused .dot reference.

I found a reference when I opened the word document and also openend the VBA editor .. extras .. references (I use the german version right now ..). There I found a line:
"NOT AVAILABLE: blabla.dot".
When I remove this line and save the file .. my script can open the document without any problems.

Does anybody know how to remove unused or unavailable references from this list?
Or maybe a better way to supress error messages than application.DisplayAlerts = wdAlertsNone ?


NetDiver
reply 2

You can use google to search for other answers

 

More Articles

• won't recognize DisplayControl Property
• VB Script Crashes Access When Exporting to Excel
• Help with using Outlook from Access
• New to VB
• Need help with VBA project, need it to take dates input by user
• Problem with integer function
• Custom file description keywords: read/write in VBA via API
• Allowing the user to pick a cell in excel
• Standalone aplication
• VBA Editor fails to start from Access 2003
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• Excel Unprotect WorkSheet problem in Exc
• Access Security Warnings
• Getting New Textbox value without using
• Intersect method
• How to Read Images from Word Dosument.
• XP style appearance
• How to read directory information into a
• Using Excel from Access
• Check the feasibility to program with th
• Trying to get just the file name
• Excel Application.MacroOptions and libra
• Argument syntax problem
• Calling procedure upon deactivate
• What is the difference between Excel Dat
• VBA for Outlook: How to create a Hyperli

Hot Articles

• Using HTML Help in Microsoft Excel VBA
• Problem with integer function
• Office 97 / Windows 2000 Compatability
• Administration tool
• VB in Excel Macros versus VB Express
• obtain data of next 10 days
• Vba commands used to connect to sql
• I need help figuring out what is crashin
• Welcome to the VBA discussion thread!
• DLL/OCX Redirection from Word template
• screen resolution
• For Each Next Loop
• Modify .PRJ File
• Microsoft Access 2002 printer dialog
• VBA SDK mfc sample

Recommend Articles

• read only file opening
• VBA Syntax
• Problem with excel, VBA & Bloomberg-
• about listview in vba excel
• GroupBox Borders
• VBA How to cope with unicode strings
• how to add CheckBox?
• how can i copy my total from sheet 1 to
• possible to access word vba via c/c++?
• suppress content overwrite message in Te
• Standalone aplication
• VBA runs slowly in Excel 97
• How to create a hyperlink in Excel Chart.
• Form Requery
• [OTP] VBA Using combobox in Excel