powerpoint-vba

VBA Powerpoint 2010 replacing text in Headers and Footers

£可爱£侵袭症+ 提交于 2019-12-08 07:35:40
问题 Having a challenge replacing a [DOCID#] code in the header/footer of a PowerPoint template. I notice within the PowerPoint object browser that headers and footers are found in a number of parts of a Presentation (SlideMaster, NotesMaster, HandoutMaster, TitleMaster, and then each individual Slide). I'm running the code from in XL, and have Dim'ed with references to the PowerPoint Library. Set ppPres = ppApp.Presentations.Open(sTemplate) Set ppMaster = ppPres.SlideMaster With ppMaster

Vba Powerpoint name a table

狂风中的少年 提交于 2019-12-08 03:41:57
问题 I just pasted a table from Excel to PowerPoint with this code: pptApp.CommandBars.ExecuteMso ("PasteAsTableSourceFormatting") There are other Shapes on this Slide. How can I make PowerPoint to find the pasted table on the Slide and name it? 回答1: Whenever you paste something in PowerPoint it appears on the topmost layer so you can get a reference to it and optionally set the name with this function: Option Explicit ' *********************************************************** ' Purpose: Get

VBA for shrinking the font in PowerPoint when text overflows

喜夏-厌秋 提交于 2019-12-08 03:01:57
问题 I'm trying to figure out a macros for PowerPoint files that I export after language conversion through a CAT tool. In some of the language pairs the translated content will not fit into the source file text boxes due to the differences in the language lengths. Therefore, the translated and exported PowerPoint files contain multiple shapes/text boxes that have some content outside of the visible areas of such shapes. I was wondering what is way to get the newly exported textual content within

Change the image of an image shape

僤鯓⒐⒋嵵緔 提交于 2019-12-08 01:56:20
问题 I want to be able to change the image of an image shape by clicking on an button in my userform. In the internet I found the function UserPicture , but the image simply stays the same. Private Sub ChangeImage_Click() ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Visible = True ActivePresentation.Slides("Slide1").Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\Desktop\SolutionWrong.jpg") End Sub Private Sub HideImage_Click() ActivePresentation.Slides("Slide1").Shapes(

Error: “The specified data type is unavailable” When pasting Shapes as PNG format in PowerPoint

我与影子孤独终老i 提交于 2019-12-08 00:59:22
问题 I need to write a macro to convert all grouped diagrams (shapes, arrows and text) in a PPT presentation to PNGs. (I am converting the PPTs using some eLearning software and the diagrams end up corrupt; and I need them to be PNGs because enhanced metafiles also present issues). I've been using some slightly modified code from a macro that converts Pictures (enhanced meta files) to PNGs. All I did was change msoPicture to msoGroup: Sub ConvertAllPicsToPNG() Dim oSl As Slide Dim oSh As Shape For

In powerpoint VBA, how to change the spacing of a font in a textbox?

自闭症网瘾萝莉.ら 提交于 2019-12-07 23:43:28
问题 Do you know what the command in VBA is in order to space out some text? I looked on the internet and didn't find anything that would work. this "SOMMAIRE" textbox has no spacing and this, is what I want that textbox to look like : there is more space in between the letters more exactly, I am looking for the VBA code for this exact button : 回答1: Use the shape's .TextFrame2.TextRange.Font.Spacing property. By default it is probably 0 . You can change it to other values to increase the font

How can I determine if my VB code is running on Office 2016 for Mac?

二次信任 提交于 2019-12-07 12:30:52
问题 Is there a conditional that I can use to differentiate if my Macro is running on Office 2016 for Mac or Office for Mac 2011 回答1: In Office 2016 for Mac, there is a new conditional called MAC_OFFICE_VERSION to test which VB version the user is running. The following example shows how it to use it in your code: Sub VersionConditionals() #If MAC_OFFICE_VERSION >= 15 Then Debug.Print "We are running on Mac 15+" #Else Debug.Print "We are not running on Mac 15+" #End If #If Mac Then Debug.Print "We

How to make a progress bar in powerpoint vba?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 07:07:34
问题 How can I make a progress bar with PowerPoint VBA? It should be done as an animation on a slide. 回答1: Is this what you're looking for? http://www.pptfaq.com/FAQ00597.htm 回答2: This one will put the bar at the top and prevent it from appearing on the first slide (unlike the pptfaq script): http://www.faronics.com/news/blog/how-to-add-a-progress-bar-to-powerpoint/ In Power Point, go to Tools > Macro > Visual Basic Editor. In Office 2010 you might need to activate the Developer tab in order to

PowerPoint 2007 - Set language on tables, charts etc that contains text

一笑奈何 提交于 2019-12-07 00:54:23
问题 So I've got this macro that basically scans each slide in PowerPoint and sets the specified language. Works great. Howerver, it skips containers that aren't text boxes. I'd like it to apply the language on tables, smartart, charts etc. Basically anything that may contain text. Is this even possible? This is the current code: Public Sub changeLanguage() On Error Resume Next 'lang = "English" lang = "Norwegian" 'Determine language selected If lang = "English" Then lang = msoLanguageIDEnglishUK

VBA Powerpoint 2010 replacing text in Headers and Footers

丶灬走出姿态 提交于 2019-12-06 15:28:51
Having a challenge replacing a [DOCID#] code in the header/footer of a PowerPoint template. I notice within the PowerPoint object browser that headers and footers are found in a number of parts of a Presentation (SlideMaster, NotesMaster, HandoutMaster, TitleMaster, and then each individual Slide). I'm running the code from in XL, and have Dim'ed with references to the PowerPoint Library. Set ppPres = ppApp.Presentations.Open(sTemplate) Set ppMaster = ppPres.SlideMaster With ppMaster.HeadersFooters .Footer.Text = Replace(.Footer.Text, "[DOCID#]", sDocID) End With If ppPres.HasNotesMaster Then