Macro in QAT not referenced to saved workbook - macros

I have an excel template that has a macro button in the quick access toolbar (QAT). When I save the template as an Excel Macro Enabled Workbook, the button found in the QAT is linked back to the macro in the original template, not the macro found in the new file I just saved. Is there a way I can get the QAT toolbar in this new file to reference the macro in the saved file instead of original template?

I figure it out finally. I needed to add it for the current document only, not all documents (default). Opposite of what I intuitively thought. It probably has something to do with how the macros are stored with each option.

Related

Visual studio code - create a macro that copies content over files

I'm looking into creating something like a macro for localization of strings. Until now, I have only find that (maybe) a custom Code Action might be what I need.
After I select some code, let's call it selection, I want the to:
Ask me for a name
Write to another file: name = selection
Write in current file: (some_fixed_code)name(some_other_fixed_code)
Is there any way to create that macro, for it lo launch with a left click option or a keyboard shortcut?
Thanks in advance!

Change title of untitled tab in Visual Studio Code

I'm building a VS Code extension which includes changing the name/title of untitled-1 tab (unsaved file).
I tried running the below code in debugger console of extension but it didn't reflect in the editor:
vscode.workspace.textDocuments[0].fileName="myFile"
Is it not possible or am I missing something?
It is still (Q1 2020) not possible, but the next VSCode 1.42 will name its Untitled editors differently.
Untitled editors in VS Code are text buffers that have not yet been saved to disk.
You can leave them open for as long as you like and all text content is stored and restored between restarts.
Untitled editors were given generic names such as Untitled-1 and counting upwards.
In this release, untitled editors will use the content of the first line of the document for the editor title, and include the generic name as part of the description:
Note: If the first line is empty or does not contain any words, the title will fall back to Untitled_* as before.
So while you cannot set the title yourself (still readonly fileName), technically... changing the first line of that file would be enough to change the title of said "Untitled" editor.
With VSCode 1.43 (Q1 2020), a new setting workbench.editor.untitled.labelFormat allows to control whether untitled editors should use the contents as title or not.
Possible values are content or name.
Configure 'workbench.editor.untitled.labelFormat': 'name' to get the previous behavior back where untitled editors would have a short title, such as Untitled-1.
It's not possible - if you check out the source code for the API definition in vscode.d.ts, you'll see that fileName is declared as readonly:
export interface TextDocument {
// ...
readonly fileName: string;
// ...
}
Unfortunately, it seems that the readonly attribute isn't reflected in the API docs on the website.
This mainly happens if we create a new file in the OPEN EDITORS section, thus they appear as unsaved. To prevent this, create a folder for storing your files, and then in that folder, create your new file then it will show options to name it, also you can add a file type extension like .cpp.
TIP: vsc-rename-files extension to rename your files.

How can I output the code for my model into a word document without taking a screen shot?

I want to include an example of my model code within my project report. I have tried taking a screenshot of my code but it is just too long to be legible. I am therefore wondering if it is possible to output an image of my model code that has not been minimised or cut up into a word document for annotation?
(I assume the reason you don't just copy and paste is that you want to preserve the colors?)
Use “Save as Applet” on the File menu. From the resulting HTML file, cut out the applet part and just keep the code part.
Direct support for "Save as HTML" is coming in NetLogo 6.0; see https://github.com/NetLogo/NetLogo/issues/645.
If Seth guessed wrong and you just need a monospace font, you can just copy (ctrl-A,ctrl-C) in the Code tab, paste into your Word document, and set the font to any monospace font (like Courier New).
If Seth guessed correctly and you want syntax highlighting, you can get the Vim syntax file, open your NetLogo file in Vim, select the code range, and then use Vim's TOhtml command. You can then read this HTML file into your Word document.
Note that using Word for reports involving code is a terrible idea: the code will immediately be out of sync, as soon as you make further changes. Instead, learn LaTeX use the listings package to read your code into your document.

How do I correctly apply a conference/journal paper template in MS Word to correctly use styles, etc.?

I spent a significant amount of time trying to apply a scientific conference paper template, made in Microsoft Word, that I want to document this problem (and my eventual solution), in case someone faces a similar difficulty (and in case I forget how I did it, I can refer back to this). In this particular case, the conference template was this, but I think many conferences and journals offer similar templates, so this question should have fairly broad interest.
The question is, given this template (which is really not a template in the MS Word sense), how can I create a document that uses the styles defined therein? How can I sure that when I save the document, it will not revert back to some other style definitions defined in Normal.dot?
In MS Word, "templates" are defined in .dot, .dotx, or .dotm files. The .dotx and .dotm formats are for newer versions of Word and the difference lies in whether Macros are disabled or enabled. Despite this definition, some organizations (such as conference organizers or journal publishers) will supply a .doc (or .docx, etc.) file, also calling it a "template" and asking you to use the styles and other formatting elements defined in it. If you were to start editing this file directly and then save it, you might be surprised that the next time you open that document, some of the styles may differ from what you saw when you were initially editing the document. This is because of a clash between the style names provided in the initial file and your Normal.dot template, which is the default template that your instance of MS Word uses. Here are the steps you need to do to avoid this problem:
When you first open the "template" supplied by the conference organizer / journal publisher, immediately save this file as a Word template by choosing "Save as" from the Office button (or File-> Save as... in older versions) and selecting .dot, .dotx, or .dotm in the "Save as type" field. Furthermore, you should save this in "Templates" folder for your installation of Word. In most versions, there is a shortcut to this folder in the top of the left panel of the "Save as" window. Give the file some name like "MyConferenceTemplate.dot".
Next, close the .dot (or .dotx, etc.) file that you just saved. This will help avoid that inadvertently that editing the template.
Create a new document (by clicking Office button->New or similar). On the left panel of the window that opens, select "My Templates...". You should then see the template which you created in step 1. Select this as the template to apply to your new document.
Start editing the newly created file and applying the desired styles...

See raw code/text from copy paste

I doing some formatting from copy/paste. When I copy a table from Word, and I want to insert it in my program, I need to edit the table formatting to show the info like I want.
When I copy from word I can view whats copy in clipboard magic:
Is there a way to get the formatting, or do I need to create a new table for scratch with the data listed in clipboard magic?
I Clipdiary the "copy" is read as HTML
This makes me wounder, is it possible to get the html code?
Yes, the HTML is present as CF_HTML. See reference on MSDN: http://msdn.microsoft.com/en-us/library/aa767917(v=vs.85).aspx
If you just want to SEE it, ClipMate has a Binary display that will show you a binary dump of the data. It's available in the trial version. If you don't see the Binary tab in the display window, turn it on in the Tools | Options | Editor dialog.