Managing Word from Access

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Hello,

I am trying to create a word document from within access
and I am having trouble moving text from a control on a
form into the word document. I can open Word and add a
document using a template file but when I go to push text
into the document I get an 'RPC server is unavailable'
error.

The second line here is what generates the error:

WordObj.Documents(stemp).Select
Selection.TypeParagraph

where WordObj is a valid reference to an active word app
object and stemp is the newly added document

I am using MSACCESS 98 and OFFICE 10 on an XP machine.

Any help would be highly appreciated.

Regards,

ALAN
 
I can open Word and add a
document using a template file but when I go to push text
into the document I get an 'RPC server is unavailable'
error.

The second line here is what generates the error:

WordObj.Documents(stemp).Select
Selection.TypeParagraph

You would be better off asking this sort of thing in the Word VBA group.

The answer is, however, that you can't use the Selection object unless the
document is visible and activated. In any case, you don't need to use the
Selection, as a Range object would be quicker and easier to manipulate.

Hope that helps


Tim F
 
Back
Top