type Automation was not defined for the function?

jversusjjversusj Member Posts: 489
good day all,

i have been working on a Word automation where, from the customer card, I can generate customer letters regarding short-paid invoices. I created my processing report that generates the letter through a client installed on the terminal server since that server is running Office 11, the same version our AR staff is running.

I did all my testing from my local machine (client connecting direct to server) and it works flawlessly. I click my button and my letters are created. hooray :). Last night i tried to make this functionality available in our live system. I connected remotely (which means i connected to the same terminal server where i did my development) and I imported my objects. when i attempted to create some letters for testing purposes, i suddenly received the error "The type 'Automation' was not defined in the function." This AM, back in the office, i connect using my local client and all works fine. Any ideas?

My workstation has Office 2007. When i design the report from my workstation, i of course see 'unknown automation' since i built it using the prior version of office. Regardless, it works from my PC. Now, if i connect to terminal server and run the client there, i can see the Microsoft Word 11 automation objects in designer. everything looks right, but it will not actually run. I am confused.

thanks in advance for any advice on how to get around this. Our AR staff works at a different facility and always connects using terminal server, so my solution fails completely for them.

the error is being thrown on the following line:
wdDoc := wdApp.Documents.Add(TemplateName);

where
Name DataType Subtype Length
wdDoc Automation 'Microsoft Word 11.0 Object Library'.Document
kind of fell into this...

Answers

  • jversusjjversusj Member Posts: 489
    okay - i was able to get this working through the terminal server, but the change i made doesn't entirely make sense to me.

    in my line: wdDoc := wdApp.Documents.Add(TemplateName);, the TemplateName refers to the full UNC path to the word .dot template appropriate for the short paid invoice. In my code, i define the TemplateName manually (i know, hard-coding is bad but i didn't want to create fancy setup tables and such for this). I had the .dot files living on our Sharepoint site, so i was defining the template name as follows:
    TemplateName := '\\sharepointsite\dept\it\Shared Documents\NavARTemplates\SalesTaxTemplate.dot';

    i changed this to point to a standard network share (not a sharepoint library direct UNC path) as follows:
    TemplateName := '\\server\parentdirectory\Accounting\Credit Department\NavAR Templates\SalesTaxTemplate.dot';

    the automation works when connected via terminal server and from a local client connection when i define the TemplateName in this manner.

    so, my problem is solved, but any ideas why i could not point to a template saved in sharepoint?
    kind of fell into this...
Sign In or Register to comment.