How to force Word to do a SaveAs on generated document - ms-word

We have a system where we are generating a report as a Word document (using RDLC).
The report is created in a temporary directory, and then Word is launched to display it to the user.
Word is launched, and the report loaded by:
_wordApplication = (Word.Application)Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"));
object tempFileNameObj = documentPath;
_wordDocument = _wordApplication.Documents.Open(ref tempFileNameObj);
What I want is to convince Word that this is really a newly created, unsaved file, so it will give the user a SaveAs dialog when they save it (rather than save back to the temporary location).
Ideally, I would like to be able to specify the target directory, and offer a default name.
While the Word is being launched, I can do what I like using Automation, but after Word has been launched, my application will be disconnected from Word, and I would prefer not to leave any macros floating around in the document.

You can rename your .doc file to .dot (Word Template) and if you launch it afterwards, it will create a new File looking exactely like your .doc

If you're not using a macro I believe that the only way to archieve this would be to save the file that they will download be a read-only or user defined template file this way if they wan't to make changes to it they wil have to save it with another name in their computer to save the changes made. If you can use a macro you can archieve more options and even force a save as dialog when the document is opened or when it's closed. I hope this helps as I couldn't find any more information without using a macro.

Related

Can you change the path of a database file?

I have an Excel spreadsheet on my desktop. I pull parameter data from it. I want to move it from my desktop to somewhere else. How do I do this?
Having something in the Data section as you show in your image means that it's referenced somewhere in your model. In this case you used an Excel object from the connectivity palette.
Your mission is to find that object and change the path there after moving it:
On this example, I have an Excel File element called parameters and if I want to change the path, I have to find the file again using the "..." button to the right of File:
When you do that, it automatically changes the path.
So here's all I could figure out. I had to change all of the instances where I refer to the database so the Population is "Initially empty".
Once I did this, I deleted the databases and had to save and close the model. Once I reopened it, the Resource had disappeared. I then moved the Excel file and re-imported it, but I'm sure there's a better way.

Is there a way of suppressing the dialog asking if you want to save on a specific file?

When a user double clicks an item in one of my files, it opens a temporary file for them to edit using DTE. Once they are done editing that temporary file they close it and it adds to the parent file. That works great.
My issue is, is that when they go to close the temporary file, it asks them if they want to save. In this situation clicking no is the right thing to do else it asks you to save the file as something. Is there a way of changing this so that it doesn't ask the user and always just closes the file without saving it?
Thanks in advance.
While the DTE methods don't expose a way to do this, you could leverage IVsUIShellOpenDocument instead, and then explicitly add the RDT_DontSave, RDT_DontSaveAs, and potentially the RDT_DontAddtoMRU flags, via the grfOpenStandard argument passed to IVsUIShellOpenDocument.OpenStandardEditor or similar.
Alternatively, you could use IVsRunningDocumentTable.ModifyDocumentFlags to add the flags after the fact.
But for that, you'll need to retrieve the document cookie with something like IVsRunningDocumentTable2.FindAndLockDocumentEx.

How to create a printerSettings file

When I change printer settings in Xlsx file, then saving and unzip it, I can see printerSettings folder that contains a printerSettings1.bin file.
But, when I do the same with Docx and Pptx - there is no printerSettings folder nor printerSettings1.bin file.
What do I have do to save the Docx/Pptx files while saving the printer settings in a separate file?
Excel, PowerPoint and Word are all different apps. They share quite a few features but each has its own feature set. PPT doesn't save printer properties the way the other Office programs might. In fact, I'm pretty sure it doesn't save anything unless the user specifically goes to File | Options | Advanced and instructs it to use the specified (limited set of) properties when printing the current presentation.
In that case, it stores the properties to be used in \ppt\presProps.XML

Renaming file with filepicker.io

Here is my use case: the user will click a "save" link and will be presented with a filepicker.export() dialog, choose a location and name and save a file. Here's the exotic part: I won't have the file yet at that time. It needs to be downloaded first with a GET request, and then stored in filepicker. I won't know which file to start downloading until the user clicks "save".
This can be dealt with by first downloading the file when the user clicks "save", and only then displaying the filepicker.export() dialog. However, I find this cumbersome, since the user will have to wait for the download to finish to be able to choose a filename and location.
It would be much better to allow the user to first make their choice, for example "Dropbox/image.png", and store some sort of placeholder while the download is running: "Dropbox/image.png.part". Later, when the download finishes, I could write the data to the file and rename it to "Dropbox/image.png".
Here are my questions:
Is it possible to append ".part" to the filename that the user chose in the filepicker.export() call?
More importantly, while I know how to write to the file when the download is done, is there any way to rename it? I tried creating a new fpfile object with the same filepicker URL and a different filename, the new filename was ignored (though the write succeeded).
My recommendation would be to first call filepicker.export call on an empty file and allow the user to specify both the name of the file they would like and the location in their cloud storage. When the filepicker.export call finishes, it will pass an FPFile into the callback. From there, you can download any necessary contents you need and do a filepicker.write to save the contents to the location selected by the user.
There shouldn't be any need to rename the file, as the user has already provided the name they want to save the file under during the filepicker.export() call.

Trying to get along with Interwoven

I am to create a new design (CSS & HTML) for a web site which is created using Interwoven ContentCenter Professional.
Now, I can see the existing files in CMS (Interwoven) but, I can't make changes. My changes are displayed only when I'm in edit mode. Nothing in the live page. I tried to submit, create editions of files but still no good.
How should I create or edit pages in Interwoven CMS?
Thanks.
If you're talking about generic pages, then once you are finished you have to click on the Generate option, then choose a directory and click Finish. Last thing you should do is to choose yeswhen it asks you to Re-generate the page.
What you are trying to do is just creating a new file, not generating a file from TeamSite's Formpublisher. It is just like if you are in Windows Explorer and creating a new file. In order to generate a file from a form entry, you need to be in the templatedata directory, ex: /default/main/branch1/WORKAREA/wa1/templatedata/category/type(on unix) or Y:/default/main/branch1/WORKAREA/wa1/templatedata/category/type (on Windows). There should be a file call datacapture.cfg there. There is another directory called data under the above path which stores your data content record (dcr) that are created from the form. This is the file that you can use to generate which will use the (tpl) file under the presentation directory.