Sign a MSOffice Document with SAPI - office-interop

I do know that in order to sign an MSOffice document, e.g. a Word document, one has to insert a signature line into document. Does anyone know how to do it programmatically using c# Office-Interop?
Using c# Office-Interop I can open,save convert to pdf but I could not find a way to insert signature line.

Related

Several occurrences of same Anchor Tag string

I have several occurrences of same Anchor Tag string in one document - /sn1/. But when signing I can see only one generated field - near the first match. Documentation says that a sign tab is created in every place a match is found in a document. What am I doing wrong or should strings be unique?
Update: I have the document in Hebrew(RTL) language, probably it's somehow connected with the problem, as I tested another document, but this time in English, and had multiple fields at the place of anchor string instances with no problem.
Well, it was incorrect convertation via libreconv gem that prevented additional sign tabs from appearing. The problem was in initial convertation from .docx to .pdf using the above mentioned gem. I do not recommend it at least for RTL documents.

Xpath accents in the source

I'm using google spreadsheet to extract a few book descriptions from an html page.
A1 contains the ISBN number and in another cell I have this =importXML("http://www.ibs.it/code/"&A1& "/scheda/libro.html","(//span[#class='tcorpotesto'])[1]").
It works but something is wrong with the accents. For example on http://www.ibs.it/code/9788823503298/hornby-nick/febbre-90ordm.html one of the words is 'Perché' but the scraped text in the cell is 'Perch?'
How can I fix this? It's the same problem with all the accented characters.
The document at http://www.ibs.it/code/9788823503298/hornby-nick/febbre-90ordm.html uses ISO-8859-1 encoding.
Google uses UTF-8.
It appears that their implementation of importXML() doesn't perform character set translation preserving these characters correctly. You could provide your own proxy / web service that runs translation inline, or file a ticket requesting a fix from upstream.

Efficient Searching in Outlook mail box

I have outlook 2011 in my mac. I have more than 30,000 emails in my mail box and would like to search from all the mails based on inputs.
Now using Advanced find I can do that , But for each and every value I have to add a new search criteria
eg . Subject contains xxx
Subject contains yyy
Subject contains zzz
it would be very difficult for me to add the search value manually if I have 1000 values to search for.
Is there any effective way to do this or do we some plugin which would read from input file and populate these vales ?
Any help would be really appreciated
I think, you can get little bit help from this -- http://derflounder.wordpress.com/2011/04/26/finding-the-hidden-search-options-in-outlook-2011/ , also this one too - https://www.gvsu.edu/cms3/assets/428A2C9A-0FB7-5B0C-BBFCF723C12E59E3/outlook_mac_search_email.pdf
In Windows version of Outlook there is a hidden tab that can be enabled by creating a new registry key HKEY_CURRENT_USER\Software \Microsoft\Office\12.0\Outlook\QueryBuilder. See here (sroll to Building DASL Queries).
This adds SQL tab to Filter dialog of Customize Current View. Here you can write a text with DASL query. The query for your example would look like this:
("urn:schemas:httpmail:subject" LIKE '%xxx%' AND
"urn:schemas:httpmail:subject" LIKE '%yyy%' AND
"urn:schemas:httpmail:subject" LIKE '%zzz%')
You can create script that takes all keywords from a text file and formats them like
"urn:schemas:httpmail:subject" LIKE '%MyKeyword%'
and construct the DASL query prorgamatically from a text file. You can store your generated queries as text files and copy them in the SQL tab as necessary.
This solution is surely far from perfect but it is relatively easy to implement. The problem is that I do not know how to enable that tab in Outlook 2011 on Mac nor whether it is possible at all. I do not have a Mac so take this rather as a hint.

Creating a Ruby Script to Convert Word Document Contents to a Text File

At work, I have two Word documents that represent differing versions of the same documents. I want to compare and extract the differences and I think I want to convert the word document to a text file and then diff it. Is this possible? Thanks.
If you have Word installed in the system, you might use the activeX Word automation object to extract the text. Use this simple, non-tested, code to get you started
word = WIN32OLE.new('Word.Application');
worddoc = word.Documents.Open(filename);
text = worddoc.content.text;
If you don't have Word or don't want to require your users to have Word installed, then you might as well extract the text with a little more effort. The recent .docx format that word uses, is nothing more than Open XML Office files in a zip archive. So, you just need to unzip the .docx file, search in the word folder for the xml file representing the document contents; and extract the text simply by parsing the XML (DOM or SAX or PORO or ..).

Is it possible to use ShellAndWait with MS Word VBA?

I get the type not defined error for XlEnableCancelKey when trying to use ShellAndWait with MS Word VBA. The Xl part of XlEnableCancelKey looks like it maybe an MS Excel type.
Also asked on MSDN VBA Forum.
Yes
In the VBA project, add a reference to the Microsoft Excel 12.0 Object Library.
Use WdEnableCancelKey instead of XlEnableCancelKey.
The reason being, for word a different enum type is defined which is used for Application.EnableCancelKey.
EDIT: Having looked at the link, I saw this line.
Application.EnableCancelKey = xlErrorHandler
Effectively, the code is wanting to use an enum value for EnableCancelKey.
Hence, you can use WdEnableCancelKey in place of XlErrorHandler.

Resources