Microsoft.Office.Interop.Word Open Specific Doc + Set Fields

MJVMJV Member Posts: 38
edited 2012-12-17 in NAV Three Tier
Hi All,

I have been going crazy with the Microsoft.Office.Interop.Word DotNet variable.

I am able to open Word, but have been unsuccessful in finding a method to open a specific doc and to set text fields in the document.

Does anyone have a sample which works in 2009 R2?

Thanks so much,

Michael

Comments

  • deV.chdeV.ch Member Posts: 543
  • MJVMJV Member Posts: 38
    Thanks so much for your response.

    I have lots of code that manipulates Word documents, but I am having trouble executing the code using the microsoft.Office.Interop.Word assembly from NAV 2009 R2 as a DotNet variable in a Code Unit.

    I was hoping someone had written some C/AL code which used the assembly.

    I am able to open Word from NAV using the assembly, but have not been successful at manipulating it at all, even to the extend of making the Word application visible.

    I can only verify that I am starting Word successfully from NAV because I can see it in the Task Manager Processes list every time the code executes.

    Thanks again for your time and attention.

    Michael
  • mdPartnerNLmdPartnerNL Member Posts: 802
    All my older c/all code with Excel works in the RTC but Word is a problem. Didn't think about the interop but would love to see some examples too.
  • Benno67Benno67 Member Posts: 39
    Would be very nice to have a word-interop sample.
    Using Interop intead of Word could solve the security and heap problems we face....
  • MJVMJV Member Posts: 38
    Hi All,

    Thanks for your input.

    I gave up on the thing and will re-visit it when we upgrade to version 2013.

    In the meantime, I implemented what I needed to do using the Automation functionality.

    If I understand correctly, Automation uses COM technology, which is older, but proven.

    It also has its own set of issues, but they are surmountable or live-withable.

    Michael
  • Benno67Benno67 Member Posts: 39
    Hi Michael,
    Because I got crazy too, I thought of the most logical solution: NAV2013.
    You can find the sample you need in CU 5054, works for me.
    Benno
  • MJVMJV Member Posts: 38
    Thank you Benno,

    I did read that 2013 had vast improvements in the Interop assemblies.

    We are about a year out from upgrading, however, so I will have to wait until then.

    In the meantime, thanks for the tip on CU 5054.

    Michael
Sign In or Register to comment.