Re: Filling Word Form from Access

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I tried this already, "Set appWord = New Word.Application" does start
a new WINWORD.EXE process but I can't seem to do anything with it, eg
if I follow that line with "appWord.Visible = True" I don't get a Word
window appearing.

That's strange.

Let's see whether yr system allows you to do something completely basic as in:

sub testingword()
Dim wdapp as new word.application
dim doc as word.document
wdapp.visible = true
set doc = wdapp.documents.add
end sub

Do you see the newly created document?

--
Krgrds,
Perry

System: Vista/Office Ultimate
<fmackay@xxxxxxxxxxx> wrote in message news:1170929393.341719.291120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 7 Feb, 17:47, "Perry" <drum...@xxxxxxxxx> wrote:
Ok, let's bring in some phasing and see what problems

If you were to skip using the active instance of Word (the GetObject
instantiating) and use
a brand new instance of Word

Replace this

> Set appWord = GetObject(, "Word.application")
> If Err = 429 Then
> Set appWord = New Word.Application
> Err = 0
> End If
> With appWord
> On Error GoTo ErrorHandler
> Set doc = .Documents.Open(DOC_PATH & DOC_NAME, , True)

by
Set appWord = New Word.Application
With appWord
On Error GoTo ErrorHandler
Set doc = .Documents.Open(DOC_PATH & DOC_NAME, , True)
'...etc
End With

I tried this already, "Set appWord = New Word.Application" does start
a new WINWORD.EXE process but I can't seem to do anything with it, eg
if I follow that line with "appWord.Visible = True" I don't get a Word
window appearing.

Is wdApp instantiated and can you get object variable "doc" instantiated as
well ...?

Not quite sure what you mean here, I'm afraid I'm complete beginner
with VB

cheers

Finlay


.



Relevant Pages

  • Re: Filling Word Form from Access
    ... a brand new instance of Word ... If Err = 429 Then ... Set appWord = New Word.Application ... On Error GoTo ErrorHandler ...
    (microsoft.public.office.developer.vba)
  • Filling Word Form from Access
    ... Dim appWord As Word.Application ... Dim rst As ADODB.Recordset ... If Err = 429 Then ... Set appWord = New Word.Application ...
    (microsoft.public.office.developer.vba)