Access 2000 Runtime and Word 97 
Author Message
 Access 2000 Runtime and Word 97

Hello,

Access 2000 Runtime crashes when I run the following VBA code:

    Dim worddoc As Word.Document
    Dim wordapp As Word.Application
    Dim letterPath As String

    letterPath = GetLetterPath

    Set wordapp = CreateObject("Word.Application")
    wordapp.Visible = True
    Set worddoc = wordapp.Documents.Open(letterPath)

It crashes just before the last line of this code snipette.  GetLetterPath
returns  a string, which is the full path, including the word document name,
of a Word document on the server (e.g. X:\Letters\myWordFile.doc).  The NT 4
Workstation that this runs on has Access 2000 Runtime and Office 97
installed.  I was wondering if anyone has had similar problems with Access
2000 Runtime and Word 97.  Thanks for any help,

Mark Erickson



Sat, 26 Oct 2002 03:00:00 GMT  
 Access 2000 Runtime and Word 97
I did not find a true solution to this error (I suspect it's a bug in Access
2000 runtime -- the code I was using worked fine with Access, but not Access
Runtime), but I did find a work-around solution, thanks to Johan's post
about embedding Word Documents in Access.  I added a hidden (visible=false),
bound object frame to my form and then set the source object of the frame to
whatever Word document I'm using,  in VBA.  This does not crash.  Here is
the code I used (Word_Doc is the name of the bound object frame):

    Dim wordDoc As Word.Document
    Dim letterPath As String

    letterPath = GetLetterPath

    Word_Doc.Class = "Word.Document"
    Word_Doc.sourceDoc = letterPath
    Word_Doc.Verb = acOLEVerbOpen
    Word_Doc.Action = acOLECreateEmbed
    Set wordDoc = Me.Word_Doc.Object

    wordDoc.Application.Visible = True
    wordDoc.Application.Activate

Mark Erickson


Quote:
> Hello,

> Access 2000 Runtime crashes when I run the following VBA code:

>     Dim worddoc As Word.Document
>     Dim wordapp As Word.Application
>     Dim letterPath As String

>     letterPath = GetLetterPath

>     Set wordapp = CreateObject("Word.Application")
>     wordapp.Visible = True
>     Set worddoc = wordapp.Documents.Open(letterPath)

> It crashes just before the last line of this code snipette.  GetLetterPath
> returns  a string, which is the full path, including the word document
name,
> of a Word document on the server (e.g. X:\Letters\myWordFile.doc).  The NT
4
> Workstation that this runs on has Access 2000 Runtime and Office 97
> installed.  I was wondering if anyone has had similar problems with Access
> 2000 Runtime and Word 97.  Thanks for any help,

> Mark Erickson




Mon, 28 Oct 2002 03:00:00 GMT  
 Access 2000 Runtime and Word 97
Just as a follow up, the document frame must be visible, evidently.  I just
made the form a dialog box and put the frame outside of the viewable area.
(Another workaround).


Quote:
> Hello,

> Access 2000 Runtime crashes when I run the following VBA code:

>     Dim worddoc As Word.Document
>     Dim wordapp As Word.Application
>     Dim letterPath As String

>     letterPath = GetLetterPath

>     Set wordapp = CreateObject("Word.Application")
>     wordapp.Visible = True
>     Set worddoc = wordapp.Documents.Open(letterPath)

> It crashes just before the last line of this code snipette.  GetLetterPath
> returns  a string, which is the full path, including the word document
name,
> of a Word document on the server (e.g. X:\Letters\myWordFile.doc).  The NT
4
> Workstation that this runs on has Access 2000 Runtime and Office 97
> installed.  I was wondering if anyone has had similar problems with Access
> 2000 Runtime and Word 97.  Thanks for any help,

> Mark Erickson




Tue, 29 Oct 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using Runtime Access 2000 And Full Ver Access 97 Same CPU Same Time

2. distributing an app written in access 2000 runtime but client still uses access 97

3. Access 97 Runtime and Access 2000.

4. Failure starting Access runtime 97 with Office 2000

5. Runtime Access 2000 and Office 97

6. Win/Off 2000 and Access 97 Runtime

7. Recordset index problem Word 97 & Access 2000

8. Access 97/2000 Field in Word Document

9. Telling Word 2000 to use Access 97 for DDE

10. Passing Userforms to subs (Word 2000 and 2002, I did not try Word 97)

11. Why does this piece of code work with Word 97 but not Word 2000

12. Convert Word 97 WordBasic to Word 2000 VB code

 

 
Powered by phpBB® Forum Software