How to delete a form from a cell in a Google Colab notebook? - google-colaboratory

I might be going crazy, but I believe I read all the existing documentation on Google Colab and I couldn't figure this one out. Maybe it's not possible, but I find this to be very weird.
I am aware that the form can be hidden, and that I can simply copy paste the contents of the cell and just paste it in a new cell that doesn't have a form, but these are hacks and not how a regular user would try to do it.
I am wondering if I'm going crazy and I just can't see the delete form button, or did someone at google colab UX simply forgot about the delete form menu? (or maybe they chose to not add it for a reason I can't understand)

You specify the form with ##param. Forms are simply interpretable Python comments.
For example
i = 0 ##param {type:'slider', max: 10}
To remove the form, just remove all ##param, including the initial ##title
i = 0
The "Add a form" menu simply inserts the ##title parameter. There is no menu to remove this line.

Related

Word VBA: Make macro easy to run

I've made a form-letter document with a macro that performs the mail merge. I don't want the user to have run it from the menus, and I want this to be portable. If there's a way for a button to appear on each user's ribbon or quick command menu, I'm not familiar with it.
So I put a button in the document itself. Unfortunately, every form-letter created has the same button in it. I suppose I could write the code to delete every one, but I think that would be slow.
Is there a way to assign a shortcut key to an existing macro, and have it reside in the document?
I had to implement something pretty similar to what you were referring to some 10 staff. My solution (by no means as portable as desired) was to export the macros and forms from my Normal template to the other users, I coupled this with Ribbon customization and it worked well. Unfortunately, when a change was needed, I had to trudge over to everyone's machine individually.
I would suggest you stick with your solution of deleting button after the merge is complete. Here's some code to help with that:
Sub DeleteCommandButton()
For Each o In ActiveDocument.InlineShapes
If o.OLEFormat.Object.Name = "CommandButton1" Then
o.Delete
End If
Next
End Sub
Good luck, hopefully this helps.

Manually changing Google Custom Search's search box and button

I want to make my own custom search box and button for GCSv2.
Here is my code:
(pastebin because I am too lazy to make my code look right)
http://pastebin.com/p4yThTma
And the code I want the search box and button to be linked too,
http://pastebin.com/SK1Df7rs
i was trying to find a way to do it as well but i couldn't
on google webpage there isn't enough information about modifying the GCSE
https://developers.google.com/custom-search/docs/element
i would like if someone already customize it to share it with us

Excel Button Growing

I'm working on a workbook in Excel 2010 that someone else created (I don't know which version they were using) with a button in it that invokes a macro. There are a lot of macros defined, so I'm right-clicking on it to find out which one it calls, but the context menu doesn't appear. Instead, when I click off, the button gets larger. I can make this happen as many times in a row as I'd like. There is another button the same worksheet that has the same context menu problem, but instead of growing, the text shrinks each time. There is another button that functions normally when I do this.
Growing buttons in Excel is a fairly common issue, with several theories about why this happens, including the use of multiple monitors or using proportional fonts. I have yet to see a definitive answer about this, but there are several workarounds that may work for you.
Delete and re-create the buttons.
Programmatically set the height and width of the buttons when the workbook is opened and when a button is clicked.
Select the button with another object or two on the sheet and group them.
Don't use them at all.
My personal choice is #4. As an alternative to buttons, I either use hyperlinks or shapes with macros assigned to them.
I think you want to enter "Design Mode" in the work book:
You should be able to right-click on the button to see what it does after that.
I have this same issue. I have two Excel workbooks with similar buttons on each. This only happens on one of them, but it happens every time I open that file.
I have found a sort of work-around. I open a blank Excel document, then I open the affected one and the buttons do not change size any more. When I open the second one, I have to drag it into the window with the already-open file. If I double-click on it, it opens in a new window and the problem remains.
I have the same issue sometimes. In my case, I could replicate it 100% on one file but it was inconsistent on an virtually identical file. I also found the size error wasn't permanent -- I could save and reopen the file to restore the button's appearance. I could also create a new window and then discard the damaged window.
For me, the button resized when I accessed the sheet's HPageBreaks collection. I was able to avoid the problem by temporarily changing the window view as follows:
ActiveWindow.View = xlPageBreakPreview
' do pagination stuff using HPageBreaks
ActiveWindow.View = xlNormalView

Hide command button on word doc

I have a .doc with a command button (cmdStart) which opens a form.
After populating the form I click a button to close the form and populate the .doc.
I want to hide the initial cmdStart on the .doc as well when the form closes,
Ive tries document.shapes(1).visible=false and cmdStart.visible=false but none seems to work.
Any ideas?
thanks
(ps I cant just opne the form from the autonew, I need the cmdStart visible to begin with)
You have several options to deal with that. However, you won't be able to hide your command button but you will be able to remove it.
Removing a command button can be done by the following code:
Private Sub CommandButton1_Click()
CommandButton1.Select
Selection.Delete
End Sub
(Note that usually you would be able to hide text in Word by setting the font hidden, e.g. by calling Selection.Font.Hidden. However, this does not affect controls.)
If you deleted the button and you need it later on again you will have to re-create it. In that case it might be a good idea to mark the position of the button with a bookmark.
Another option would be to use a MACRO button field. Such a field can be inserted from the Insert Field dialog and can be used to launch a macro.
If you really wanted to "hide" the button, you could set the Height and Width to 0.75 and it's virtually gone. Then resize back to "show". I've also seen people put them inside tags and hide the tag. Hope this helps

How add text in PowerPoint which on click is replaced by a cursor?

Everybody knows "Click to Add Title" in the first page of the PowerPoint slide - the moment you click on it, the text disappears. This is very useful feature for creating templates. Does anybody know how to mimic this behavior? Is it a standard functionality or requires some VBA code? If so how to get this effect.
Yes, there are a few different methods to do this. As said, placeholders are one way, and if you go into the Open XML document (rename the ext. of your file to .zip), you can even change the words "Click to Add Title". Another way is to use text boxes and a macro to simulate this.