VBA - applying bullet-point style from the slide master to selected text boxes - vba

In VBA for PowerPoint, I want to applying bullet-point style from the slide master to selected text boxes. Is this even possible? I've been searching the internet for ages on this, and can't seem to find anything even close.
I can select or place text boxes on the slide in VBA, but I want to use the bullet-point layout as defined on the slide master - I just don't know how to select it, and once selected I assume I use the Shape.PickUp and Apply (or is there another way of doing this that I haven't thought of?)
Any help greatly appreciated.
David.

Related

Looking to record a macro in word, but picture options aren't available

Currently trying to build a macro in word so that I can simply select a picture I've pasted in the document, then click on the macro so that it sets the layout option of the selected picture to square, and the distance from text below it to 0.1". However, the record macro button doesn't allow me to select a picture, nor can I figure out how to build it from scratch as I don't even know where to start. Any help to get my on my way would be greatly appreciated. Thank you!

Creating a PPT macro to send slide to section based on day/time

First time poster here! I am hoping someone can help me find a way to create a macro that would direct the powerpoint to advance to a certain section depending on the day/time. I have four sections (weekdayAM, weekdayPM, weekendAM, weekendPM) and a single slide at the start of the presentation with a textbox start button. Ideally, I would like to enable an onclick macro to direct to the appropriate section based on the day/time conditions.
Any ideas?

VBA script to insert anchor position for autoshapes in Microsoft Word 2007

I'm beyond the limits of my kindergarten-level VBA skills so would like to ask if anyone here can help me write a VBA script to help me work stepwise through my Word document and adjust the anchoring position of all the AutoShapes in the document.
I have a 400-page book in Microsoft Word with at least one and sometimes several marginalia (sidenote) on each page in a thin column to the left of the main body text column. These sidenotes are a concise 'pointer' to a particular point made in the body text and need to appear directly to that point's left.
Each sidenote is in its own AutoShape (within a textbox in that shape). The AutoShapes were placed by the author in an inconsistent way. Mostly they are anchored to a position on the page.
However, I need to repaginate. This will cause the body text to flow differently and I need the sidenotes to flow with it (approximately or exactly)!
So before I repaginate I want to make sure I anchor each AutoShape to the paragraph it belongs to and not to the page it is currently on.
I don't know if that can be done automatically, since I don't know how Word could deduce a purely spatial relationship between an AutoShape and a paragraph.
So I'm guessing I have to make do with a "semi-automatic" process. Something like this:
Press a button to start VBA script
Select next AutoShape
Prompt for user to enter cursor in body text where anchor is to be placed
Resume macro
Place anchor for that AutoShape in that position
Change vertical position paramater of AutoShape to "relative to paragraph"
and "0 mm"
(Alternative, not 0 mm but another value deduced to more
accurately position AutoShape)
Change width parameter of AutoShape to
a particular fixed value 37 mm (some of them were a little
inaccurately drawn)
End cycle and go back to beginning to
Select next AutoShape
Hope that is all understandable.
I've tried to record a VBA script to do some of this but have no idea how to build in the user prompt.
Any help much appreciated!
Craig
You may be better off creating a macro that works on one shape at a time, or anchor all the shapes manually (which you're almost doing anyway) and then write a macro to take care of the various parameters and settings you want.
If you really want to prompt the user while the macro is running you'll need to look into modeless dialogs (not possible on the Mac). See this link: http://www.bettersolutions.com/vba/VXV113/SE846743531.htm
Basically, you'd have to create your own dialog and then show it modelessly so that the user could still place the cursor before hitting OK. If you're new to VBA, this could be difficult to set up.
While searching for solutions to this, I found a post on another forum from someone trying to do something very similar. He was developing a set of tools for editors using Word and until I find the ultimate solution I am using his "Shapes" tool which allows me to change parameters on each AutoShape I select at-a-click instead of opening up and closing a dialogue box each time, plus selecting a different tab each time... His tools can be downloaded at his Editors' Toolkit website.

How to hyperlink Visio Characters object

I'm working on a VBA macro to automatically add hyperlinks within a drawing file, so that when a certain word is mentioned in the text, I can link to another page in the drawing.
According to MSDN and Visio's help, a Hyperlink object can be associated with a cell, characters, row, or section object. However, I can't find any way to actually associate a hyperlink with anything but a shape.
So the question is, how can I hyperlink a single word within a paragraph of text in a single shape in Visio?
I'm only familiar with two ways to trigger a hyperlink navigation within Visio:
Add a Hyperlink to a shape and click on the shape (or select the hyperlink from the shape's context menu).
Add a call to the Hyperlink shapesheet function in a cell formula. Making a change that triggers that cell's recalc would then follow the hyperlink.
The best idea I can think of, and it isn't very good, is:
Make sure your shape is a group - if it isn't, convert it to group.
Change the group's properties to SelectMode=visGrpSelModeMembers1st and DisplayMode=visGrpDisModeBack.
Drop a new shape, sized and centered over the word in question. Make the new shape transparent (partial transparency here could be used for highlighting).
Change the DblClick event's formula to "Hyperlink("yourURLhere")".
Add that shape to the group.
Now, double-clicking on the word should actually involve double-clicking on the new subshape, which will trigger the hyperlink. This is really only viable if your shape is designed to work with this idea - many out-of-the-box shapes will not work well here, as steps 1 and 2 can have ugly side-effects.
I hope someone else knows a more elegant way around this problem.

Reset Excel to default borders

Ok, so you know what a spreadsheet looks like when you open a new on in Excel; the borders are a light blue. These are only on the screen though, if you print the sheet it will not have borders. Say you've applied some various formatting to the sheet (background color, etc.) and those "default" borders are gone. My question is how to you get them back? Simply doing a Clear Formats will not always work.
Specifically I am talking about Excel 2007 but I believe all versions do this.
Any ideas?
Thanks,
Ryan
I had this issue, grid lines appeared to be missing on some cells.
Took me awhile to figure out that the color of those cells were white.
I clicked format cell, pattern and then selected "no color" (instead of white)
The the grid lines were visible again.
I hope this helps others as it took me a while to figure out why.
If you have applied border and/or fill on a cell, you need to clear both to go back to the default borders.
You may apply 'None' as the border option and expect the default borders to show, but it will not when the cell fill is white. It's not immediately obvious that it has a white fill, as unfilled cells are also white.
In this case, apply a 'No Fill' on the cells, and you will get the default borders back.
That's it. No messy format painting, no 'Clear Formats', none of those destructive methods. Easy, quick and painless.
Just go to Home> Cell Style > Normal
khir
If you're trying to do this from within Excel (rather than programmatically), follow these steps:
From the "Orb" menu on the ribbon, click the "Excel Options" button near the bottom of the menu.
In the list of choices at the left, select "Advanced".
Scroll down until you see the heading "Display options for this worksheet".
Select the checkbox labeled "Show guidelines".
My best answer for this is to simply use format painter. This might be a bit of a pain, but it works rather well as the problem you are facing is that Gridlines are covered by fill and other effects that are layered on top. Imagine putting a piece of white paper on top of your grid, the grid lines are present underneath, but they just don't show.
So try:
Clicking on a cell in the spreadsheet with the format that you want
Under the ribons, go to Home and format painter, it should be a smaller icon near the paste button.
Now highlight any cell that you want to apply this format to and it will set the font, color, background etc. to the same as the cell selected. The value will be preserved.
From my experience this is the easiest way to do this quickly. Especially when pasting things in and out of excel.
Again this is not the programmatic way of solving this problem.
Another way, There is check box Page Layout tab with Gridlines [ ] View which should be checked.
you just need to change the line color and you can apply it without problem
I was having the same trouble with importing from Excel 2010 to Access, appending an "identical" table. Early on in the wizard it said not all my column names were valid, even though I checked them. It turns out that it saw an "empty" column with no column name. When I tried using the import wizard to create a new table instead, it worked. However, I noticed that it had added a blank column to the right of my data and called it "Field30". So I went back to the spreadsheet I was trying to import, selected the columns to the right of the data that I wanted, right-clicked and chose "clear contents." That did the trick and I was able to import the spreadsheet, appending it to my table.
In Excel 2016 for Mac, I clicked the Excel menu, then clicked Preferencesā€¦
I then clicked the View icon.
whereupon I found a Gridlines Checkbox next to a Color Picker.
Regardless of whether the Gridlines checkbox os checked or not, if you change the color in the Color Picker dropdown menu, your cell borders will become that color. (I believe the change took place after i quit excel and opened the document the next day to continue working on it but I can't accurately remember.)
Changing the color picker back to Automatic will return your cell borders to the default (black) color on-the-fly.
N.B. Because I'm a newbie I cannot insert the screen shots I prepared ahead of time. šŸ˜ 
I understand this is an old post. But it is programmable. Otherwise make sure your fill is set to "No Fill" and your boarders are set to "No Boarder" via the user interface shown in the previous posts.
Sub clear()
Range("A4:G1000").Borders.LineStyle = xlNone
Range("A4:G1000").Interior.ColorIndex = xlNone
End Sub()
Select the cells that you need to affect the style and go to Home then click cell style and select Normal as show in the below snapshot