Run-time error '509': this command is not available- WordBasic for Word 2013 - macros

I have a macro code which has following line of Wordbasic call:
WordBasic.FormatFont Font:='Courier New', Points:=8
I have run the code, it gives runtime error 509 in this command in word 2013.
Whereas I have written individual macro in word 2013 for wordbasic.Formatfont, it ran absolutely fine. I don't know what is the issue behind it.
I don't find any rectifying way in google. Is there any other way to resolve wordBasic call in Microsoft Word 2013?

WordBasic returns an Automation object (Word.Basic) that includes methods available in Word version 6.0. It is obsolete. Use instead Visual Basic objects and methods.
WordBasic:
WordBasic.FormatFont Font:='Courier New', Points:=8
in VBA is
With Selection.Font
.Name = "Courier New"
.Size = 8
End With
This answer is not exactly what are you asking for, rather a workaround. But IMHO it is the best way - I suggest not to use WordBasic, use VBA. See Converting WordBasic Macros to Visual Basic at msdn.com.

Related

How to change auto-format for Transact-SQL code in Visual Studio 2017?

How do I stop Visual Studion 2017 form auto-formatting my T-SQL code and changing the case of keywords, functions, etc? I want to keep the code exactly as I type it. The only relevant option I see is under Editor - SQL Server Tools - IntelliSense - Casing for built-in functrion names, which does not seem to do anything (I changed it to Lower case, restarted the IDE, but it still converts them to upper case). I did not find anything relevant under the T-SQL90 and U-SQL, and I do not see any other T-SQL specific settings (I'd expect something like Transact-SQL, but there is no such option). Any idea?
Here is the first place which can't be easily found without using the search bar. Also, it's not language specific either unfortunately.
Search for 'format' and turn off 'format as you type' option
Here is the 2nd place I'm aware of
Search for 'pretty' and turn off reformatting
Hope this is helpful -- if you find a SQL specific way to avoid the annoyance please post a response to my answer.

Which algorithm is used to implement search for files in Visual Studio Code / Google Chrome Developer / Sublime (Ctrl+p or Cmd+p)?

I am very impressed with the powerful search feature of Sublime which we later found in Visual Studio Code and Google Chrome Developer.
A very basic algorithm for searching may use Trie, I guess but this search for files of Sublime etc seems like some sort of a multi-direction Trie (if there is such a thing!) i.e. if you have a file name like:
"I-am-a-very-big-beautifully-created-file-and-something-else.js"
and you search for "created file", "file created", "something-beautifully", "else big", "big else" or any other combination of strings from that file's name, Sublime and Visual Studio code will find it and other files with similar names, in no time. (Google Chrome Developer version isn't very powerful though but that's not the point here).
So, I dug through the source code of Visual Studio for a little bit but still couldn't figure out how the search is implemented and which algorithm is used. I am not looking for its code. Just need to understand a high level theory of how this powerful feature, that saves us developers a lot of time, is implemented.
The VS Code functionality you're looking for can be tracked by looking into what happens when this function is called:
https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts#L365
an interesting part here (filter on the first term only , then on the whole filter):
https://github.com/microsoft/vscode/blob/d1220da07267242e9b58193da0ded43bbe7f2aa5/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts#L570
If you dig from there you will find that most of the useful stuff is regrouped in this file:
https://github.com/microsoft/vscode/blob/master/src/vs/base/common/fuzzyScorer.ts
Some notes:
The fuzzy search is pretty strict, the filter will not match if a single letter is not found or if the letters are not found in the right order. A key advantage is that you can highlight the matching part in the results and it makes pretty clear what's happening to your users.
The fuzzy scorer scores results based on a matching label/description[/path] (for a file, label = filename, description = path without name).
This looks like the code that DevTools uses for its fuzzy search in the Command Menu.
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js?l=174
And the underlying diff algorithm is:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/diff/Diff.js?q=Diff.Diff&dr=CSs&l=4
I think the name is "fuzzy search" lol. Here's a nice github repo where some kind person released an open source JS version that is a lot easier to include in your code than the VS Code version because it's on npm and it's just one file:
https://github.com/farzher/fuzzysort

Compile Swift on Windows from Silver Command Line?

I've been learning Swift for a little bit now, and I really want to use it. However, compiling Swift on Windows is quite a chore. I can do it from Visual Studio 2015 easily, but VS2015 support is very poor, and incredibly hard to work with; I would prefer to use Atom and the command line. I use RemObject's Silver to compile to .NET, but I can never get the command line to work.
When I use the Elements.exe at C:\Program Files (x86)\RemObjects Software\Elements\Bin, passing the filename as a parameter, it tells me that print is undefined.
Does anyone know how to use Silver's command line to compiler Swift?
Have you tried referencing the online documentation?
calling elements needs some libraries to import:
elements --mode=ECHOES --reference=Swift myfile.swift
I recommend using MSBuild, rather than Elements.exe, to build Elements projects from the command line. It's more complete and supports more advanced build tasks needed for some project types.
That said, --mode and --reference should definitely work. Can you post a complete command line and output?
You will need --reference=Swift in order for print() & co to be known, and --reference System.Core to use LINQ.

Shortcut for clike languages comments not working/implemented?

I'm using the Brackets code editor to code in C++ and I'm having a hard time having the shortcut for lineComment and blockComment working...
The shortcuts are [Ctrl+/] and [Ctrl+Shift+/], they work perfectly for CSS, JS.. etc but not with C++ files.
I looked into the clike.js file in the CodeMirror folder of Brackets, the blockCommentStart, blockCommentEnd and lineComment are correctly defined.
Is it a known issue? has anyone found a workaround?
Before that,I was coding with Notepad++ and this feature was the one I used the most. It's really hard not to have it anymore
You said you saw that blockCommentStart, blockCommentEnd and lineComment are correctly defined in clike.js. From CodeMirror documentation
This file defines, in the simplest case, a lexer (tokenizer) for your
languageā€”a function that takes a character stream as input, advances
it past a token, and returns a style for that token. More advanced
modes can also handle indentation for the language.
It is used to highlight the c++ file. But also it could be used to auto comment line with shortcut. However it is probably not implemented for C++. For this feature comment addon from CodeMirror might be used http://codemirror.net/addon/comment/comment.js since The addon also defines a toggleComment command, which will try to uncomment the current selection, and if that fails, line-comments it.
This was a Brackets bug, but it was fixed in the Sprint 39 release.
(Fwiw though, language metadata in Brackets is defined in a file called languages.json - although Brackets extensions can add to / modify this metadata as well).

Porting Visual Basic staements to Perl Win32::OLE ones

I read all the standard Win32::OLE texts such as Jan Dubois' classic and of course the official package doc, Microsoft's terse article and many others.
What I miss are rules to convert a captured VBA Excel macro statement into a Perl Win32::OLE one.
Say I have a captured VBA macro:
Sub cntrl_arrow_down()
Range(Selection, Selection.End(xlDown)).Select
End Sub
Assuming I already obtained an application (Excel) object, a "book" object, a "sheet" object and activated the sheet. Further, I selected a cell and I am looking to find the extent down of the column in which the cell is. I would like to get a 'Range' object that I can next read the range into a 2D Perl array.
Please, I need the rules, not just the answer to this particular line.
Thanks!
OK, I still don't know the answer to my original question (and that a good answer to it is still going to be useful to many), but I found an alternative set of tools, see jimtut comments and my response above.
Copying my original comment here into a full Answer, since it seemed to help the op (and maybe it will be Accepted as the Answer):
If you're using Perl, why do you have to use Win32::OLE, and not one of the Excel modules? Of course, if you're really after how to run VBA macros, that's one thing. But if you just need to interface with Excel file, there are modules for doing that in Perl (without OLE).