Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

my Vb6 MS Word 2003 VBA code crashes VS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pete - 14 Apr 2006 15:33 GMT
Hi - An earlier posting discussed this same result but I do not think I
have the same coding problems.  In the following VB6 program the
"InsertBefore" works but then VS crashes when it tries to process the
first "Find" line.  Help would sure be appreciated!

   Dim wdApp As Word.Application
   Dim wdDocs As Word.Documents
   Dim wdDoc As Word.Document
   Dim wdSel As Word.Selection
   Set wdApp = New Word.Application
   Set wdDocs = wdApp.Documents
   Set wdDoc = wdApp.Documents.Add
   wdDoc.Activate
   wdDoc.Content.Text = "aba"
   wdDoc.Content.Select
   Set wdSel = wdApp.Selection
   wdSel.InsertBefore "d"
   wdApp.Visible = True
   ' either of the next two, by itself, crashes VS
   wdSel.Find.ClearFormatting
   wdSel.Find.Text = "b"
   wdSel.Find.Execute
   ...
- Pete
Pete - 14 Apr 2006 19:18 GMT
Hi - I found the work-around for this bug: (1) use late binding; or (2)
re-register the Word 2003 Type Library msword.olb after any update to
Excel.

- Pete
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.