Hi Ronny (and anyone interested),
attached is the latest update of the FREE BDSwapImage macro. The latest version has built upon the QuickSwap module (select 2 images and then swap them with one click) by adding a QuickSwapSize module which not only swaps 2 images, but also swaps their sizes.The macro also has the original module SwapImage module which pops up a userform and allows the user to choose how the 2 images are swapped (e.g. swap the position of their top left corners, bottom right corners, etc). Here is a screen capture of how the modules appear in the Macro Manager docker, assign shortcut buttons/keystrokes to make them one click away:
Refer to the video below to see the intented use of this macro:
Hi Jeff,
I will work on some code and then show you. It can be done. The style sheet will only work if the user has used styles to begin with, but this is how it works in all word processing/desktop publishing programs. For example, if you have not set a heading as a "heading 1", "main heading" or whatever...then CorelDraw does not know that it is a heading, just as Word doesn't. However, if it is set as a Heading 1 then it is not that difficult to write code to redefine what a Heading 1 is, etc. In some ways this makes it easier for us. The user only ever uses one set of styles and then the macro offers a choice of appearances for each of those styles. This is how the Word Style Sets work. They replace every Heading 1 with new attributes, every Heading 2 with new attributes, Body Text with new attributes, etc. I actually had this happening some time back and I am kicking myself for not keeping the code.
I know I can do this...I will get onto it ASAP. I am really glad we are both trying to achieve the same thing
Best regards,Brian.
ggut said: This is all too cool! I had no idea Brian was so active in this channel (coreldraw.com forum). Cool beans. Love Dizzy's Shaping as well.
This is all too cool! I had no idea Brian was so active in this channel (coreldraw.com forum). Cool beans. Love Dizzy's Shaping as well.
Hi ggut, thanks . I am trying to figure out who you are, by the way. Were you in the Corel Newsgroups and if so, under which name?
Brian said:I know I can do this...I will get onto it ASAP. I am really glad we are both trying to achieve the same thing
Ok, cool. I'll be very surprised if you can pull it off inside a p. text frame... specifically, changing a style sheet and a range of text inside frame updating automatically...
DELETED: I deleted the contents of this post as the video was a little too large.
I am only one line of code away from cracking it with what we wish to do. The ONLY thing I cannot do is find the code to check what styles already exist in the document. I can write code to apply styles to individual paragraphs, and I can do things like: for paragraphs 1 to 5 apply style X, for paragraphs 6 to 10 apply style Y, etc. This alone is pretty useless, however, as we don't have the same number of headings and paragraphs in every document, of course. Once I figure the code to retrieve the active style from a paragraph - I am there, I can then write code to replace all text of one style with another, which will give the desired effect we are looking to achieve. e.g. code can run through the paragraphs finding a Heading1a and replace it with a Heading1b, find Heading2a and replace with Heading2b, etc. This will change the whole document with one click.
The following video is very simple. It first shows selecting a few paragraphs, one at a time, and applying a style to them via buttons. I then select several lines and apply a different style to them with another button. Finally, I use a single button to run through the whole text box applying a red style to every odd Paragraph and a blue style to every even Paragraph. The styles are identical in terms of font, font size and before/after spacing...I could have made the styles anything I liked. There is a hard return at the end of each line, thereby making each line a new "paragraph".
Please note the macro really is applying Styles to Paragraphs, it is not applying simple formatting to lines of text.