Jump to content

Zerotonine

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Netherlands

Everything posted by Zerotonine

  1. Hello. I have a new question. I am coding an add-in for MS Word. By pressing a button a Save File Dialog pops up. The user can simply save the current Word file. I have taken two approaches; each has it's own problems. My first approach would look something like this (this is code found in a MSDN tutorial): public void OnAction(IRibbonControl control) { Stream myStream; switch (control.Id) { case "Opslaan": SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Word-document (*.docx)|*.docx|Word 97-2003-werkmap (*.doc)|(*.doc)"; saveFileDialog.FilterIndex = 1; saveFileDialog.RestoreDirectory = true; saveFileDialog.InitialDirectory = @"C:\Temp\waldo"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { if ((myStream = saveFileDialog.OpenFile()) != null) { // I have no idea what to do here } } break; . . . etc. } } The SaveFileDialog pops up, but I can't save the file. I've tried several approaches, but how can I just save the Word document? In this code snippet I can specify the default file location. I tried a different approach, which also pops up a SaveFileDialog and DOES actually save the file. But the problem is I don't know how to change the default save location: this.applicationObject.ActiveDocument.Save(); // SaveFileDialog pops up, but starts in My Documents as default location. I'd like to change this... Either approach is OK, but I just want to Save a file in a custom default location. any help is appreciated...
  2. Hi all! I realize this is my first message and I have not properly introduced myself. But I need some help fast, so I will attend to that later. I've already browsed your forum and got some good answers, but still one remains: I have been having a problem and cannot find the answer on the Internet yet. I am trying to find a way to: 1. change the default save path for Office 2007 applications 2. lock users in this default path so they can only browse dówn the directory tree and not up. I succeeded at doing 1: I use the Group Policy Management Console to change the Group Policy Objects. This works. The default save path is set. 2. remains a mystery however. So my question remains: is it possible to lock the user in the default save path in MS Office (and in MS Office only)? So; when a user hit Save (As) the window should open in the default folder and the user should not be able to browse up...If possible, how do I tackle this? Thanks a million in advance...
×
×
  • Create New...