Is there a workaround in Visio to have more than nine colors? (A LOT more) [closed] - vba

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 15 hours ago.
Improve this question
Years ago, I created a custom stencil that utilized a theme for coloring. (Every drawing I make is derived from a single "template" file that has the same theme.) One master in the stencil may have four different shapes in it, each of which may have different font, fill, and line colors, and each of those colors might change based on the master's existing Shape Data. (Colors are coded using =IF() statements in the ShapeSheet.) I was using more than the six Accent, Dark, and Light colors, so some of them are hard-coded RGBs, but most are using THEMEVAL("light") etc.
Well now I've been asked to change all the colors. Sure I can change the nine theme colors, but there are nearly 100 masters in the stencil, so I'm going to have to hunt for every RGB on every shape of every master. Yikes. I'm trying to future-proof things so this doesn't happen again.
So no matter what, I'm pretty sure I have to open every master in the stencil and re-code every color of every shape.
My first thought was to dump all of my colors onto the template file as Shape Data. So for example, I could have my_color_1 be a String of value RGB(255,0,0). In each master, I could give the master's sheet the same colors (only the ones needed), and could reference ThePage!Prop.my_color_1; dragging the master onto my template file would change colors automatically if they were different. The major drawback of this is that I'd still have to manually open every master and give its page the appropriate colors.
Then I learned about Shape Data Sets, and I thought all my problems were solved. I can make a single Shape Data Set with every single color in it and Apply that Shape Data Set to every master in the stencil. (I'd still have to re-code the colors in the ShapeSheet of every shape of every master.) BUT there seems to be some kind of bug here; if I Apply the Shape Data Set to a master in the stencil, and then I change a color (RGB string) in the Shape Data Set, and then I try to Apply it to the same stencil again, the new color doesn't push. So if I make a mistake or if the colors change again in the future (They probably will), I'm in the same boat.
My last thought was using VBA to do what I described in "My first thought" (changing the master's page's Shape Data to include the colors). I'm not good with VBA, so this really seems like a monster undertaking.
If anyone has any advice or help they can give, I would sincerely appreciate it. I feel like there has to be a better way of doing this, but I don't know what it is.

Related

Making a shape act like a connector and snap to another shape. Visio

I'm pretty new to Visio but I'm trying to figure how I could possible design a stencil to snap to a connector marker on another stencil/shape.
I have looked into actually editing the connector itself too see how its designed. I'm wondering If I could recreate the Endpoint on a single location for a shape stencil. Which would snap into place on to the designated shape, when a user drags it on to the worksheet.
Would anyone have any ideas or pointers on how I could achieve this?
I found my solution here.
http://visiozone.com/?p=298
Pretty much I had to take a 1D shape (A line) and Adjust the parameters of its boundary box inside the master shape, then group it too get it to act like a 2d shape. After, I could edit the group and add the shape I wanted then. Deleting the line and adjusting the endpoints.
Highly recommend checking the link out. I hope this helps anyone out there with this issue.
I'm not sure why its really difficult to find information on Visio. Being a 19 year old program. Haha.

Conveniently randomize image via button from folder/slide?

I often spend hours bringing pictures into PowerPoint templates one by one and trying to customize the way a presentation whose behavior is very different.
If there were a way to randomly select an image from all of the images on a different slide or excel file or folder and have them appear based on the probable weight assigned to them, it would be a huge time saver.
I've seen various methods of having a random object appear, and some of them don't even require a macro, but importing the images is always very time consuming. If anyone knows of a better/faster way to link a folder with a group of images or something along these lines to an object that is randomized, please help.
Importantly, showing a random image from a batch group without customizing the way each image is brought in is the hard part. Adding weight helps, but it could be done by duplicating important images repeatedly.

Image recolour in Excel

I have a greyscale image with some transparent sections too. I would like to recolour this within excel (based on the value that a user types in a cell or something)
Manually, all I need to do is select the picture then in the ribbon 🡒 format 🡒 colour 🡒 more variations 🡒 more colours and select appropriately. I've tried the macro recorder on these steps but get nothing useful.
Searching the web has led me to believe that the Shape.PictureFormat.Recolor method, which I'm guessing is what I want, is only availible in Publisher. I'd rather not interface with thatfor portability reasons (in case publisher isn't installed), and I'd also like this to run as speedily as possible.
I've even considered converting the image to an array of bytes, performing the required pixel manipulations then converting back to an image, but I think that'll be slow. I also don't have a clue how.
Is there a method in VBA to recolour an image in this way, leaving alpha as it is? Perhaps with the use of an ActiveX image control? Here's an example image in case it's not clear
White 🡒 Green
Black 🡒 Black
Alpha 🡒 Alpha
If you can't find a pure object model based solution, you can try to modify the document xml. It is not the easiest of solutions, but it is far easier than pixel manipulation.
Do like this:
Save your workbook without modification
Do the color change
Save the file again, with a different file name
Unzip the two *.xlsx files you created
Analyze the differences. You'll most likely find it in the drawings folder
Recreate the changes in the xml of the second file in the first one and zip it back together. If that works, you now have a theoretical way to the solution.
If you get this to work, you can automate these steps.

Photoshop jsx image grid

What I am ultimately trying to do is to create a grid of images for print that are minor variations of the same thing (different text is all). Looking through online resources I was able to create a script that changes the text and exports all of the images necessary (several hundred). What I am trying to do now is to import all of these images into a new photoshop document and lay them all out in a grid and I can't seem to find any examples of this.
Can anyone point me in the right direction to place a file at a specific coordinate (I'm using CS5 and have the design suite so if there is a way in illustrator to do this quickly...)?
Also, I'm open to other ideas on how to do this (even other programs) easily. It's for labels so the positioning on the sheet has to be pretty precise...
The art layer object has a translate() method that takes delta x and y params. You'll need to open each image, copy it to the target document, get its current location (using artLayer.bounds) and do the math to find the deltas to position it where you want it. Your deltas can be in pixels so you'll get plenty of precision.
Check out your 'JavaScript Scripting Reference' pdf in your Adobe install directory for more details.
Ok I'm marking Anna's response as the answer because though I didn't fully test it, it seems like it should work and answers the original question with jsx. However I'm also leaving my final solution in case anyone else runs across this with the same issue and may prefer this method as well.
What I ended up doing instead is using InDesign. I figured out that it has a grid option that lets you import a number of files and place them all in an equal grid in a single command. This is almost exactly what I was looking for, except that it leaves a small border/margin in between the columns and grids and mine were designed to meet exactly.
I couldn't figure out how to make it not have the border (I have very little experience with InDesign, it may be possible). However I was able to select all my images and scale them uniformly to be the correct size, then I just selected each column and dragged it over to snap to the adjacent column and the same with rows...

VBA - validating slide against master theme

We have a list of power point template with master slide themes and we distribute this it to all our users, everything works fine if they use they use the theme and they don't change any font, font size or color. But the problem is if they change the font, font size etc, how do we know which shape or text the user changed, basically need to validate the slide against master slide theme.
The problem with your question is that you haven't indicated what you've tried, or where you've looked for an answer. That's why you would have attracted a downvote. (Wasn't me, incidentally, but I've seen that happen before.)
When you're asking a question it's also important to pay close attention to the suggested topics which will update as you type; more than once I've spent time searching for an answer, have given up and was about to ask a question here, and then found exactly what I was looking for in the suggested answers meaning that I didn't have to ask at all. In this case it would be worth checking out the suggested answer:
How to detect Theme fonts in Powerpoint 2007 VBA?
which may not give you exactly what you want, but will give you a place to start.