How to change Excel 2013 Template Miniature - thumbnails

Is there a simple way to change / replace the automatically generated Template Miniature with a different image.

I have checked this out for Excel 2016 but the process is similar.
First, the thumbnail is generated and part of the file. There is no official process. A description for brave Office pros is shown below.
You can do this:
First, close Excel!
Get to the location of your template
Make a copy
Rename the file extension to .zip
Unzip the file into a new folder using the Windows Zip utility
Search the tree of files for a file called thumbnail.wmf
Open PowerPoint and create an empty presentation
Use the function "Insert an Image" and add the thumbnail.wmf to the slide
Remove everything else from the slide
Try to ungroup - it fails with a message asking to convert to a drawing object
From here you have two options. Either convert, ungroup, change and proceed or throw away and create a new image from scratch.
Work on image and group your image (the old or a new one), then
Right click on the grouped image and click "Save as picture"
Choose the filetype "wmf" and name it the same as before and overwrite the existing thumbnail.wmf
Go INTO the folder using Windows Explorer of unpacked files, hit Ctrl-A (Select All)
Right click and say "Send to" --> "Compressed (zipped) folder". Give it a new name.
Hit F2 to rename the file
Remove the file extension .zip
Now, open Excel!
Hit "New", "Personal" and you see your template with your custom image in full width and height. Repeat steps 10 to 16 until you're satisfied.
Drawbacks: Once you edit your file in excel and save as template with thumbnails option (advanced properties) switched on, Excel will overwrite your custom wmf-file. You have to repeat the steps "Unpack -> Replace File -> Pack" every time.
I'll post an update once I found a better solution.

Here is an automation of the process that might help with understanding the process described in the answer.
Python 3 code snippet
import zipfile
import shutil
exfilename = 'MYTEMPLATE.xltm'
a_path='C:\\TEMP'
th_path='mythumbnail.wmf'
with zipfile.ZipFile (exfilename, 'r') as zf:
#Extract to temporary folder
zf.extractall(a_path)
#replace the thumbnail
shutil.copyfile(th_path,a_path+'\\docProps\\thumbnail.wmf')
#remake the zip as a new file
shutil.make_archive('TEMP_ARCHIVE','zip',a_path)
#rename back to original, replacing original
shutil.move('TEMP_ARCHIVE.zip',exfilename)
#clean-up temporary files
shutil.rmtree(a_path)

Related

Show more path in vscode tabs [duplicate]

I've got a component-based folder structure in my project. It is a bunch of component-folders with one index.js file each.
Is it possible to make Visual Studio Code display the parent folder name in the file tabs? Or am I limited to seeing a bunch of tabs that all display index.js and nothing else?
You can configure Visual Studio Code to always show parent folder names in the tabs! In your User Settings, just add this line: "workbench.editor.labelFormat": "short" (other values are "long", "medium" or "default")
Result: the files init/views.js, init/routes.js and plugins/modal.js will be presented as such:
Another option is the User Setting "breadcrumbs.enabled": true which will give you an entire row of breadcrumbs showing the complete file path:
PS: To open User Settings use the File-menu → Preferences → Settings → User Settings. To view the settings in a JSON format just click the {} icon in the top right corner.
Go to the main menu File → Preferences → Settings. And search for (Cmd + F on Mac; Ctrl + F on Windows and Linux) workbench label format.
Choose the short option.
Visual Studio Code has now improved their tab-UI to resolve this issue.
When you've opened multiple tabs with the same filename, Visual Studio Code will automatically display the parent foldername in each of those tabs.
Here's an example: I've opened event.js and two index.js files. Visual Studio Code automatically decides it's a good idea to display the foldername for the index.js files :)
It pretty much solved the bulk of my problem.
I know this is too late to answer, but in case someone is looking for the file path to show on the title bar, you can follow this:
Open settings (command + ,)
Search for title
You'll see something like activeEditorShort, replace it with activeEditorLong
Save
Source:
https://medium.com/riow/vscode-show-full-path-in-title-bar-b0cb731b330
Step 1: Go to File > Preferences > Settings
Step 2: search for "workbench.editor.labelFormat"
Step 3: select medium from a drop-down
You can install the nice-index extension for a better experience dealing with index files.
However, as of now, it only works when you have more than one index file open. This can be resolved by changing labelFormat to "short", as other answers suggest.
In VSCode 1.53 you can use thees settings:
Controls the window title based on the active editor. Variables are substituted based on the context:
${activeEditorShort}: the file name (e.g. myFile.txt).
${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
${activeEditorLong}: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
${activeFolderShort}: the name of the folder the file is contained in (e.g. myFileFolder).
${activeFolderMedium}: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
${activeFolderLong}: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
${folderName}: name of the workspace folder the file is contained in (e.g. myFolder).
${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
${rootName}: name of the opened workspace or folder (e.g. myFolder or myWorkspace).
${rootPath}: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).
${appName}: e.g. VS Code.
${remoteName}: e.g. SSH
${dirty}: a dirty indicator if the active editor is dirty.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.

How to add . to a name of a bookmark in Word

So i am using Word to create a template for the generation of a .pdf using XDocReport in Java. The problem i have encountered is that when i add a bookmark to an image in Word the allowed names cannot contain "." , for example i cannot name the bookmark estimate2.Photo , which is the name needed to correctly map the variable to the virtual object being passed. My question is the following, is there any way i can alter this default Word behaviour in order for it to allow me to add bookmarks that contain special characters like "." ?
I have found a way to rewire this default behaviour by modifying the configuration .xml files. In order to access the bookmarks file follow these steps:
Go to the .docx file right-click on it go to 7zip and open as archive.
Access the word folder and there you will find the document.xml file.
extract it
Open with notepad or any other text editor, find the bookmark start xml tag which contains the name property and modify it.
Once the file has been modified drag it back inside the archive and save.
Wow. I wouldn't have thought this would work... Nice find #Patratel
not withstanding the fact that it seems to work, I wouldn't recommend doing this for anything other than a temporary file or curiosity...
That said, here's the steps to do / test this:
The manual approach:
Add a regular bookmark (shortcut: Alt > I > K)
give it a name like dot_dot
save the file
change the extension from .docx to .zip
open the .zip folder
save document.xml to the desktop (or somewhere)
Find the text dot_dot and replace with dot.dot
save .xml file
copy .xml file back to .zip folder
rename .zip back to .docx
Open in MS Word
open bookmarks dialog (Alt > I > K)
select dot.dot from list
press Goto
A quick test of functionality
From there it is easy enough to test whether or not the bookmark can be used as normal... To that end I added a new paragraph and inserted a cross reference back to the bookmarked text. The cross reference worked.
The .InsertXML approach
Next I was also curious about #Cindy's comment about Range insert XML... It worked, to test this I used the following code in the immediate window:
' replace text in document with the equivalent XML (generates a few pages)
selection.Range.Text = thisdocument.Range.WordOpenXML
' replace the XML with the result of inserting itself into the document
thisdocument.Range.InsertXML thisdocument.Range.Text
An Automatic Approach
Sub dottyBM()
Dim newDoc As Word.Document
Set newDoc = Application.Documents.Add
newDoc.Range.Text = "Testing a dot bookmark"
Dim bmRange As Word.Range
Set bmRange = newDoc.Paragraphs(1).Range
bmRange.Start = bmRange.Start + InStr(bmRange.Text, " dot")
bmRange.End = bmRange.Start + 3
' bmRange.Bookmarks.Add "dot.dot" ' Err: 5828, Bad bookmark name
bmRange.Bookmarks.Add "dot_dot"
bmRange.InsertXML Replace$(bmRange.WordOpenXML, "dot_dot", "dot.dot")
Application.Dialogs(168).Show
newDoc.Close False
End Sub

Rename file with the information available in it

Issue - I have this large batch of pdf, word & notepad files which are required to be renamed according to the text available in each file.
For eg: I have to open file A, search the entire document for the string which will be used as its name, copy, close the file and rename the file.
After searching for some while I found that autohotkey can help me with this though I'm open to every solution. What I want to do is open the file, search for the name, select the text and use the keystroke to close and rename the file.
Could anyone help me with this?
I'm not going to give you a script but what you want can be done.
You need to collect various pieces of information when you rename a file. One of them being the current file name which you can often grab from the window title. You can use https://autohotkey.com/docs/commands/WinGetTitle.htm
If a filename is wrapped in [ ] you can remove those using https://autohotkey.com/docs/commands/StringReplace.htm
If you know the file path (folder where the file resides in) you can now use https://autohotkey.com/docs/commands/FileMove.htm to rename a file and use https://autohotkey.com/docs/misc/Clipboard.htm as a variable.
You would probably like to retain the extension (.doc, .txt, .pdf) so you can use https://autohotkey.com/docs/commands/SplitPath.htm to grab it and append that to the clipboard when you rename it.
Closing a file depends on your program, sometimes you can send ctrl+w or ctrl+w or you need to use the WinClose command so you need to add in that step before you use FileMove.

INCLUDEs are not copied during program COPY

I copy a program SAPBC414T_BOOKINGS_01 to new name ZSAPMZ_BOOKINGS_01 in a new package ZBC400_01.
I select all items including INCLUDEs. SAP asks me to rename the includes and I rename them as shown here:
However, after copying I open my program ZSAPMZ_BOOKINGS_01 in my package ZBC400_01 and I am surprised to see all INCLUDEs have the same names as in source program. Why?
Entering a new name in the popup with includes is not enough, you also need to select all the lines of the includes you want to copy before you click the Copy button.

Showing path in file-tabs in Visual Studio Code

I've got a component-based folder structure in my project. It is a bunch of component-folders with one index.js file each.
Is it possible to make Visual Studio Code display the parent folder name in the file tabs? Or am I limited to seeing a bunch of tabs that all display index.js and nothing else?
You can configure Visual Studio Code to always show parent folder names in the tabs! In your User Settings, just add this line: "workbench.editor.labelFormat": "short" (other values are "long", "medium" or "default")
Result: the files init/views.js, init/routes.js and plugins/modal.js will be presented as such:
Another option is the User Setting "breadcrumbs.enabled": true which will give you an entire row of breadcrumbs showing the complete file path:
PS: To open User Settings use the File-menu → Preferences → Settings → User Settings. To view the settings in a JSON format just click the {} icon in the top right corner.
Go to the main menu File → Preferences → Settings. And search for (Cmd + F on Mac; Ctrl + F on Windows and Linux) workbench label format.
Choose the short option.
Visual Studio Code has now improved their tab-UI to resolve this issue.
When you've opened multiple tabs with the same filename, Visual Studio Code will automatically display the parent foldername in each of those tabs.
Here's an example: I've opened event.js and two index.js files. Visual Studio Code automatically decides it's a good idea to display the foldername for the index.js files :)
It pretty much solved the bulk of my problem.
I know this is too late to answer, but in case someone is looking for the file path to show on the title bar, you can follow this:
Open settings (command + ,)
Search for title
You'll see something like activeEditorShort, replace it with activeEditorLong
Save
Source:
https://medium.com/riow/vscode-show-full-path-in-title-bar-b0cb731b330
Step 1: Go to File > Preferences > Settings
Step 2: search for "workbench.editor.labelFormat"
Step 3: select medium from a drop-down
You can install the nice-index extension for a better experience dealing with index files.
However, as of now, it only works when you have more than one index file open. This can be resolved by changing labelFormat to "short", as other answers suggest.
In VSCode 1.53 you can use thees settings:
Controls the window title based on the active editor. Variables are substituted based on the context:
${activeEditorShort}: the file name (e.g. myFile.txt).
${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
${activeEditorLong}: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
${activeFolderShort}: the name of the folder the file is contained in (e.g. myFileFolder).
${activeFolderMedium}: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
${activeFolderLong}: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
${folderName}: name of the workspace folder the file is contained in (e.g. myFolder).
${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
${rootName}: name of the opened workspace or folder (e.g. myFolder or myWorkspace).
${rootPath}: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).
${appName}: e.g. VS Code.
${remoteName}: e.g. SSH
${dirty}: a dirty indicator if the active editor is dirty.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.