|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'd posted this in the Access forum, but had no responses.
I've written a function which creates a MailMerge Letter in Word from Access, but keep getting an Error, the RPC Server is unavailable. I thought maybe it was if no instance of word was already running, but this doesn't seem to matter, it's just happens every other time I run the code. I've got no help file on this issue, so if someone could help? Even an explanation of the error would be something?? I'll paste in to point where code breaks. Function CreateInsLetter(icID As Integer) Dim wdApp As Word.Application, wdDoc As Word.Document Set wdApp = CreateObject("Word.Application") Set wdDoc = CreateObject("Word.Document") wdDoc.SaveAs ("Test1.doc") With wdDoc.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(2.54) 'Breaks Here |
|
#2
|
|||
|
|||
|
Can you try this to see if it works:
Function CreateInsLetter(icID As Integer) Dim wdApp As Word.Application, wdDoc As Word.Document Set wdApp = CreateObject("Word.Application") wdApp.Documents SaveAs ("Test1.doc") With wdApp.Documents.PageSetup .LineNumbering.Active = False ..... |
|
#3
|
|||
|
|||
|
Thanks Anna,
I get a Function or Variable not defined error at SaveAs. I've had a look for help on Microsoft.com, they say this is a Bug and have a workaround for it, but this doesn't work either. They suggest creating a temporary Word App object before creating the one to us, then deleting the temporary one. This doesn't solve the problem though either. I'm using Access97 on NT also and wonder whether this is the reason. Any other help? I've been on this for a couple of days now and running out of steam... |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Creating Word Doc from Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|