I want to write VBA code for PowerPoint that inserts a preformatted textbox, specifically wrt to bullet formatting on multiple levels (i.e. first level no bullet, second level round bullet, third indented level a dash bullet, fourth intended level a square bullet). See screenshot for example of formatting
What I have tried
I have a TextPlaceholder (so called in Selection Pane) in Slide Master that is formatted like I want and I hope I can insert that using VBA, but that does not seem to work.
Changing default text box in PPT and then using VBA to simple insert textbox VBA gets me halfway there, because it only allows me to define the first bullet level.
My question is
Is it possible to use VBA to insert a formatted a shape / textbox that adheres to format in the Slide Master (e.g. 'TextPlaceholder' in Selection Pane)?
If not, is there a different solution to insert a formatted textbox that adheres to my desired bullet levels?
Thank you
Mike
It's possible to create textboxes with up to 9 levels of formatting by editing the OOXML of the file. Here are my how-to articles: OOXML Hacking: Text Box Styles OOXML Hacking: Styled Text Boxes Complete. Those articles cover manual editing of the OOXML.
You can programmatically manipulate OOXML with VBA code using the downloads mentioned in this article: Edit OOXML with VBA - Cool Code. Using this code, find the bodyStyle section in slideMaster1.xml, copy the section and paste it into the defaultTextStyle section of presentation.xml.
Related
I would like to write a VBA macro that highlights all paragraphs that have any kind of formatting applied, causing those paragraphs to not match their style.
Then I want to highlight in a different color all text with altered font applied. This would allow me to see all the horrible mangling someone else did to a document, since many Word users ignore styles. I can probably muddle through most of the VBA required, but I have not found a snippet for specifically selecting directly formatted objects.
What have you tried?
Pressing Ctrl+A, Ctrl+Q, Ctrl+Spacebar will return all text to the paragraph and font settings prescribed by the corresponding Styles. If you then save that document with a new filename and use Word's document comparison tools, that will show you all the formatting differences between the two.
Do note, though, that the process removes formatting applies by character Styles, too.
Simple as - and no code required. That said, see also:
https://answers.microsoft.com/en-us/msoffice/forum/all/print-applied-document-formatting-not-real-styles/e291f11e-7e07-47d8-be7f-22677cdb4ac0
I want to know if there is a way to link text boxes in PowerPoint in a similar fashion as Excel so that when I update one text box (for instance, changing the title of the presentation), the other linked text boxes will update by themselves. The purpose is to avoid having to go through the whole presentation to change manually every relevant slides. I don't think there is a build in function but I am fairly new to VBA in PowerPoint (have some experience with Excel already). Any input is very much appreciated, thank you!
I am working on developing weather graphics in PowerPoint 2010 for our online weather forecast operation. I am trying to update formatted text (Word Art type formatting, such as text outlining, shadowing, etc.,) automatically within a PowerPoint slide.
Click for example map
I have looked through the numerous articles both here and elsewhere on how to dynamically update text from Excel cells in PowerPoint and other methods, but I can't find any way of updating text such as the temperature values in the map above, while still keeping the visual formatting (which is absolutely crucial for this project). Is there any way to do this in text format, or would I just be better off developing the system so that the text values on the map are actually auto-updating images, so that the formatting is preserved? If that is the route I must take, I am fine with that. I just need pointed in the right direction. Any help would be tremendously appreciated.
Thank you for your time...
I am using Word 2007.
I have to create a complex document using text from various sources.
What I want to do is crate template that forces all text that is pasted into the document to be coloured red but retain all other formatting properties.
Then I will be able to quickly identify any pasted text which have not had my styles applied to them.
Is it possible to use VBA to make this happen?
You would need to catch all possible paste operations in your document and make the pasted cells text red colored. Since there are several possible ways to perform copy/paste in Excel this is not a trivial task. Here is a nice discussion to get you started:
Catching Paste Operations
I use OpenXml for creating custom powerpoint presentation in this way: I put a keyword on the presentation, I found it during process with OpenXml and change the text value. Everything work fine but the fit option doesn't work at first.
The text box has options "Autofit: Shrink text on overflow; Wrap text in shape: On"
After my process, the new text appear on the right place but the autofit is not done, I need to click on the text box and make a input for see the autofit work. I think that PowerPoint only check option after a modification.
What I want is the autofit option is called at the end of the process. Can anyone help me?
I hope you understand what I want to do.
Thanks.
It's not possible using just OpenXML. The <a:normAutofit/> tag is used by a client application, such as PowerPoint, to render the text larger or smaller, as needed. OpenXML doesn't actually render anything, so until the client does, it will just read the text as if it is not auto-fitted.
There are a few options to think of to control this - none of them great however. One would be to use VSTO or VBA in PowerPoint to check all shapes on PPTX open and if they have a AutoFit tag, to re-render them. A second way would be to do all the font measurements yourself based on the shape's width & height and then set the font scale to the appropriate percentage. Another would be to make a textbox large enough to fit the largest amount of text you will ever insert and then turn autofit off.
Sorry this doesn't really help you immediately. I've done tons of research on this particular subject and it's all bad news.