VSTO - how to trigger WorkSite "Save as"

Hi

In Word VBA, the following VBA code would cause the WorkSite "Save as" dialogue box to pop up.

' Press the Save As button in Word 2010
Word.Application.CommandBars.ExecuteMso "FileSaveAs"

What is the equivalent command in VSTO? I.e. in my Word 2010 VSTO document solution, how do I pop up the WorkSite "Save As" dialogue box via Visual Basic code?

I tried using the above command and the local "save as" dialogue box pops up.

i.e. calling
Globals.ThisDocument.CommandBars.ExecuteMso("FileSaveAs")
or
Globals.ThisDocument.Application.CommandBars.ExecuteMso("FileSaveAs")

both pop up the local Word "save as" dialogue box.

Thanks, Alison

Comments

  • If anyone's interested, I worked out that this is an issue with the fact that my VSTO document form was using f.ShowDialog() (i.e. modal). My understanding is that modal stops all the code so when my form calls "save as" the worksite save hook-in hasn't loaded.

    I worked around this by using calling an async thread after the modal form has closed AND disposed, sleeping the thread for half a second (optional) and then calling the save as.

    However, closing the document without saving changes is another story. I can't stop getting a worksite titled "do you want to save changes" box without sleeping the thread for 60 seconds - not sure what worksite is doing in the background that briefly breaks built-in VSTO functionality?
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs