How can I automate the process of clicking on a hyperlink in an email, downloading the file, and printing it? - powershell

Currently I am regularly emailed (through outlook) a list of 20+ hyperlinks in the body of an email, which I open, save, and print one at a time. Right now I use 5 clicks for each hyperlink, which is very inefficient, but I do not know how to automate the process. How should I approach this?

Just some ideas:
Get the selected item using Application.ActiveExplorer.Selection(1)
Load MailItem.HTMLBody into IHTMLDocument object
Loop through all links in IHTMLDocument
Download each link using XLMHTTP
Save the data into a temp file
Create and use WScript.Shell object to launch the "print" verb on the file
Delete the temp file

Related

Custom Forms do not sync in Outlook with O365

I have been using custom forms for a number of years. There appears to be a new issue with O365 and TASK custom forms.
If I open a new task from a custom form, type in a characters, wait 30 seconds and then save it, I get the following error "the item cannot be saved because it was modified by another user or in another window"
So now it tried with the following:
Test 1:
I tried the same form in a .PST file and all works OK.
Test 2:
Took a standard Task Form - I did not make any changes
Saved the form with the new name “Test1”
Opened the form as a new Task, typed into the Notes/Body field.
Saved
Outlook had the same error. - "the item cannot be saved because it was modified by another user or in another window"
This test has been replicated in 3 different computers. Same issue.
Any ideas? Thanks.
This is not at all related to custom forms - you save an appointment or a task, the OST store uploads it to the Exchange store, its processes the item and stamps its own properties. OST store picks up the server changes some time later and downloads them. If you now try to save an item, you get a conflict.

How to force Word to do a SaveAs on generated document

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.

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.

Network Diagram, Word etc

Making a word document of our network set-up.
We have about 7 servers and I need to include screenshots and other info on each.
Is it possible to have a pic of the server that when clicked will open up another word doc that reveals all of the other info. Can this then be mailed to someone easily?
I think that you should have actually tried to do it in Word before asking. The answer is trivial. For completeness sake:
Right-click on the image, choose "Hyperlink..." from the menu. Select the document you want from the resulting standard file selection dialog.
That's it. Doing ctrl-click on the pickture will open up the document selected though you will probably get a security warning first.
You can also do it from a VBA macro. First select the desired image and then:
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"C:\Users\me\Documents\a-document.doc", SubAddress:=""
So you could automate the process of server discovery (or maybe you have the data in a spreadsheet that you could use), adding images and hyperlinks automatically. Probably not worth it for just 7 servers.
I'm not clear what you mean by the last part about emailing. Do you want to email the Master word document or the one opened after clicking on the hyperlink? Either way, Word has a menu option for doing this.
If you are wanting to send the document that is opened from the hyperlink - do you actually need the user to open that document or would you rather email it directly? A simple macro can be written that will ask you for the target email address and send the document directly without having to open it. There are really too many possibilities to write down here - we need more information.

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.