type Automation was not defined for the function?

jversusj
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
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

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...
0
Answers
-
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...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions