none
emulate switches word in vsto c# RRS feed

  • Question

  • hello everybody,

    I would like to hide splash's word in my addin startup.

    I used switch command line word : winword /q for to hide splash's word but is it possible to hide in addin startup ?

    In an other hand, I would like to launch my addin only if the user choose a shortcut in the desktop, I tried with : winword /lc:\myaddin.dll but it doesn't work ( word try to open myaddin.dll as a document...)

    Thank you in advance for your help

    Regards

    Thursday, October 2, 2014 9:55 AM

Answers

  • Hi ChristopheNS,

    The /l switch to start Word is used in the context of WLL addins. These are dlls built using the (older) Word C API. The /l switch does not work for COM Addins as they use a different loading methodology.

    There is an option to load COM Addins but that require you to launch Word through automation (Word Object Model) and after that Connect the Addin using:

    http://msdn.microsoft.com/en-us/library/Microsoft.Office.Core.COMAddIn_properties(v=office.15).aspx

    This is not as easy as running with a switch, I admit but it can be done...

    Hope it helps,

    Maarten


    Software Engineer * MVP-Visual Developer-VSTO

    Monday, October 6, 2014 9:13 PM
    Moderator

All replies

  • Hi ChristopheNS,

    Thanks for posting in MSDN froum.

    When the Word application is started, it checks the regstry and loads the VSTO add-ins.

    >>In an other hand, I would like to launch my addin only if the user choose a shortcut in the desktop<<

    As far as I know, there is no such methoed we can use in Word Object model to detect wheth the Word application is stated from a shortcut.

    You can get more detail about load process about VSTO add-ins and Word object model from link below:
    Architecture of Application-Level Add-Ins(loading process section)

    Object model reference (Word 2013 developer reference)

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 3, 2014 2:54 AM
    Moderator
  • Hi Fei,

    Thank you for your response.

    I can't detect if the word addin started from a shortcut, but I would like to start word with a switch indicate that word have to start my addin. In office documentation, I saw (but it doesn't work !) : 

    /ladd-in

    Starts Word and then loads a specific Word add-in.

    Example    To start Word and then load the add-in Sales.dll, stored on the C drive, type the following at the command prompt:

    /lc:\Sales.dll

     NOTE   There must not be a space between the switch and the add-in name.

    SECURITY  Use caution when running executable files or code in macros or applications. Executable files or code can be used to carry out actions that might compromise the security of your computer and data.

    Friday, October 3, 2014 11:50 AM
  • Hi ChristopheNS,

    The /l switch to start Word is used in the context of WLL addins. These are dlls built using the (older) Word C API. The /l switch does not work for COM Addins as they use a different loading methodology.

    There is an option to load COM Addins but that require you to launch Word through automation (Word Object Model) and after that Connect the Addin using:

    http://msdn.microsoft.com/en-us/library/Microsoft.Office.Core.COMAddIn_properties(v=office.15).aspx

    This is not as easy as running with a switch, I admit but it can be done...

    Hope it helps,

    Maarten


    Software Engineer * MVP-Visual Developer-VSTO

    Monday, October 6, 2014 9:13 PM
    Moderator