Is there a way to find MS Word 2010 Content Controls by Tag name? - contentcontrol

I have a MS Word 2010 document that has a lot of Content Contorl (100s). I want to find a Content Control by tag name from the UI, not a VB script. Using the standard "Find" does not do it. None of the "find" options seem to help.
Is it even possible without using a VB Script?

In a word, no. As you have discovered, there is no 'Find' option for this in the UI.

Related

How to compare two word documents (.docx) using AppleScript?

I am trying to compare two MS Word Docx's (.docx files) using Macro's but Mac OS is not supporting VB Script and Microsoft is not providing the support for MAC OS as well.
Hence I found that, If I want to execute Macro's then I need to write AppleScript. I am very new to AppleScript, could anyone please help on this.
1) In the script, i have to get two documents from some source location and want to compare both the doc's using MS Word compare functionality.
MS Word Doc1: "http://source/old.docx";
MS Word Doc2: "http://source/new.docx";
You can't use AppleScript in this instance, I suspect you're confusing the OS-level automation provided by AppleScript with the Office-specific automation provided by Microsoft macros.
If you wish to compare two .docx files for differences, you either need to make use of a Word document-aware "diff editor" or you need to make use of a code-based solution (perhaps using docx4j or similar). Here are a couple of links to get you started:
How to make TortoiseSVN diff .dot and .dotx Word template files
https://www.altova.com/diffdog/word-document-comparison.html
http://blog.martinfenner.org/2014/08/25/using-microsoft-word-with-git/
It is possible to do it.
Just open the Spotlight Search => write AppleScript Editor, open it and then File => Open Dictionary, in the list, find Microsoft Word.app then click on Choose and in the input searcher write "Compare"
and you will see all the commands available to compare two .docx files using Microsoft Word Office and AppleScript

Save Outlook Email as text file, and then run a script on it?

I'm using Outlook 2007. I have no experience with Windows programming or VBA, as all of my background is on Unix systems. I am attempting to have Outlook save each incoming emails as text file, and then a run a python script which will parse this text file.
I found this question which seems to provide some VBA code to accomplish the first task, but I'm not sure how to utilize it. I open the Visual Basic Editor, but have no idea how to proceed from there. I tried saving the text as a module, but when I attempt add "run a script" in an Outlook rule, no scripts are available. What am I doing wrong?
EDIT: Clarification.
I'm assuming you're familiar with coding at some level, even if not on Windows. You may want to do some general background reading on Outlook VBA; some resources on this would be a Microsoft article, this article from OutlookCode, and so on - there's a ton of resources out there with walkthroughs and examples.
Addressing your specific question: take a look at this Microsoft KB article, which describes how to trigger a script from a rule.
The key to getting started once you've gotten your VBA editor open is to double-click a module on the left, for example ThisOutlookSession (under 'Microsoft Outlook Objects').
That should give you an editor you can paste code into. Bear in mind that (per the above MS page) your procedure must accept a MailItem object, which will be the item that the rule has in hand, so the linked example you gave would have the first couple of lines changed from:
Sub SaveEmail()
Dim msg As Outlook.MailItem
' assume an email is selected
Set msg = ActiveExplorer.Selection.Item(1)
' save as text
[...]
...to:
Sub SaveEmail(msg As Outlook.MailItem)
' save as text
[...]
Essentially you're being handed a MailItem rather than having to create it and connect it to the selected item in Outlook.
To achieve the second task of 'running a script' on the file, I'm assuming that you want your VBA to make changes to the file after it's been saved? This is pretty straightforward in VBA, and you'll find lots of examples for it. One pretty simple outline is in this answer.
Edit based on comments: to launch an external tool, you can use either the Shell command if you don't need to wait for it to complete, or you can use one of the many Shell-and-wait implementations floating around, for example this popular one. Or, you can use the WScript approach in this answer.
Note that you'll need to ensure Outlook is set to allow macros to run, and you will probably want to sign your code.

How to start to write a Windows context menu

I would like to write a context menu for Markdown files for Windows XP, when I right click on a Markdown file it should display "View in browser" option. It could use MardownSharp or Discount to convert it in HTML and show it using the default browser. I guess that building such feature shouldn't require too much knowledge of the Windows platform. My question is: where should I start considering the fact that I would want to write this tool without using MS Visual Studio (I would like to use opensource software)? Could it be possible to use Mono?
See this answer on how to convert Markdown to HTML. As far as adding this as a context menu, this is a built-in feature of the Windows registry:
Browse to or create the following key. This assumes the file extension is .mdml (as I am unfamiliar with any set standard on this file format). If that's not the case, replace .mdml with the file extension(s) you are looking for, or * for all files, regardless of extension.
HKEY_CLASSES_ROOT\.mdml\Shell\
Browse to or create a new sub-key called something like "View in browser" and a sub-sub-key called "Command" (must be this word). In that key, modify the default to display the program and arguments to launch (e.g. C:\WINDOWS\SYSTEM32\NOTEPAD.EXE "%1").
You should now be able to browse to
HKEY_CLASSES_ROOT\.mdml\Shell\View in browser\Command\
and see the launch parameters in (Default).

How do I convert Word files to PDF using Word 2007 programmatically?

I used to convert Word documents to PDF via Word Automation: Enumerate the CommandBars until one containing "PDFmaker" was found, enumerating its controls and executing it.
With Word 2007 this no longer works - although the PdfMaker Com Addin is installed and accessible via the Acrobat menu.
PDFmaker is required for quality reasons. Therefore I cannot use the Microsoft "Save as PDF" addin; so the SaveAs method described in another post here is not applicable.
Any ideas?
A common way to get a PDF out of Word is to print to a virtual PDF printer. I could bet you have one installed. Maybe you find the quality appropriate.
The code would be:
Application.ActivePrinter = "whatever PDF printer you've got"
ThisDocument.PrintOut OutputFileName:="c:\whatever.pdf", PrintToFile:=True

Expression Web: Shortcut doesn't point to an exe file, but I want to use it to edit

Problem: I have to support users who need to edit web pages. Some of these web pages exist only as textarea controls. Fortunately, there is a firefox plugin that allows the user to open the textarea in a default text editor. Unfortunately, this plugin requires you to point to the EXE file of the text editor you want to invoke.
This is a reasonable requirement, but ##$%^ Microsoft Expression Web is one of those applications whose shortcut .lnk file does not appear to point to a real EXE file. If there is an EXE file somewhere, it's hidden.
Question:
How can I locate the actual EXE file so people can configure Microsoft Expression web to be their editor of choice?
Update: I should have emphasized that I was looking for a way to automate this via script or batch file (hence the SO posting, in case anyone's "not-programming-related" spidey sense was tingling).
I found my executable in the following location:
C:\Program Files\Microsoft Expression\Web Designer\EXPRWD.EXE
I'm not sure if that gives you what you need, but you can always have your users (or programmatically) search for EXPRWD.EXE and go from there.

Resources