If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Add bullets to textframe via Access vba (Office 2007)
I'm using Access to generate a series of PPT slides.
On one of the slides, I have a bunch of individual lines that I am writing to a text frame as a block (I create a string containing each of the lines with a crlf following each line) when I pass this string to a function. As part of each line, I have prefaced an extended ascii character to each line that meets a certain set of data characteristics. What I would like to do is: 1. count the number of lines that contain this character, then remove the character(easy with the replace function). 2. turn on bullets for the first "n" lines (corresponds to those lines with the prefixed character) of this text frame, and set the bullet to a red checkmark. I'm sure this has something to do with the "ParagraphFormat.Bullet" property, but would appreciate any code samples. Thanks. ---- Dale |
#2
|
|||
|
|||
Add bullets to textframe via Access vba (Office 2007)
OK, here is what I have so far.
intDirected = Len(LearningDemands) - Len(Replace(LearningDemands, Chr$(251), "")) LearningDemands = Replace(LearningDemands, Chr$(251), "") oShape.TextFrame.TextRange = LearningDemands For intLoop = 1 To intDirected With oShape.TextFrame.TextRange.Lines(intLoop).Paragrap hFormat.Bullet .Type = ppBulletUnnumbered .Visible = True .RelativeSize = 1 .Font.Color = RGB(255, 0, 0) End With Next This seems to work with a dot as the bullet. Still need to figure out what the unicode value is for a checkmark. Also, if one of the lines of text wraps around within the frame, the line reference appears to count the wrapped text as another line, although it doesn't put the bullet on that line. So, I'm wondering whether there is a way to check to see whether the first character in a line is the chr$(251) character, and if so, how do I delete the first character and then set the bullet characteristics? ---- Dale "Dale Fye" wrote: I'm using Access to generate a series of PPT slides. On one of the slides, I have a bunch of individual lines that I am writing to a text frame as a block (I create a string containing each of the lines with a crlf following each line) when I pass this string to a function. As part of each line, I have prefaced an extended ascii character to each line that meets a certain set of data characteristics. What I would like to do is: 1. count the number of lines that contain this character, then remove the character(easy with the replace function). 2. turn on bullets for the first "n" lines (corresponds to those lines with the prefixed character) of this text frame, and set the bullet to a red checkmark. I'm sure this has something to do with the "ParagraphFormat.Bullet" property, but would appreciate any code samples. Thanks. ---- Dale |
#3
|
|||
|
|||
Add bullets to textframe via Access vba (Office 2007)
Ok, based on my original response (to myself), I tried the following:
For intLoop = 1 To oShape.TextFrame.TextRange.Lines.Count With oShape.TextFrame.TextRange.Lines(intLoop) If Left(.Text, 1) = Chr$(251) Then .Text = Mid(.Text, 2) With .ParagraphFormat.Bullet .Type = ppBulletUnnumbered .Visible = True .RelativeSize = 1 .Font.Color = RGB(255, 0, 0) End With End If End With Next The problem with this code is that the following line: .Text = Mid(.Text, 2) seems to insert a hard carraige return at the end of those lines which do not wrap within the text frame. ---- Dale "Dale Fye" wrote: I'm using Access to generate a series of PPT slides. On one of the slides, I have a bunch of individual lines that I am writing to a text frame as a block (I create a string containing each of the lines with a crlf following each line) when I pass this string to a function. As part of each line, I have prefaced an extended ascii character to each line that meets a certain set of data characteristics. What I would like to do is: 1. count the number of lines that contain this character, then remove the character(easy with the replace function). 2. turn on bullets for the first "n" lines (corresponds to those lines with the prefixed character) of this text frame, and set the bullet to a red checkmark. I'm sure this has something to do with the "ParagraphFormat.Bullet" property, but would appreciate any code samples. Thanks. ---- Dale |
#4
|
|||
|
|||
Add bullets to textframe via Access vba (Office 2007)
After messing around with this for quite a while, this was what I came up with.
intDirected = Len(myString) - Len(Replace(myString, Chr$(251), "")) myString = Replace(myString, Chr$(251), "") oShape.TextFrame.TextRange = myString For intLoop = 1 To intDirected With oShape.TextFrame.TextRange.Paragraphs(intLoop) With .ParagraphFormat.Bullet .Type = ppBulletUnnumbered .Character = 10004 .Visible = True .RelativeSize = 1.5 .Font.Color = RGB(0, 128, 0) End With End With Next ---- Dale "Dale Fye" wrote: I'm using Access to generate a series of PPT slides. On one of the slides, I have a bunch of individual lines that I am writing to a text frame as a block (I create a string containing each of the lines with a crlf following each line) when I pass this string to a function. As part of each line, I have prefaced an extended ascii character to each line that meets a certain set of data characteristics. What I would like to do is: 1. count the number of lines that contain this character, then remove the character(easy with the replace function). 2. turn on bullets for the first "n" lines (corresponds to those lines with the prefixed character) of this text frame, and set the bullet to a red checkmark. I'm sure this has something to do with the "ParagraphFormat.Bullet" property, but would appreciate any code samples. Thanks. ---- Dale |
Thread Tools | |
Display Modes | |
|
|