A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add bullets to textframe via Access vba (Office 2007)



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2009, 05:33 PM posted to microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default 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  
Old December 2nd, 2009, 05:54 PM posted to microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default 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  
Old December 2nd, 2009, 07:56 PM posted to microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default 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  
Old December 2nd, 2009, 08:56 PM posted to microsoft.public.powerpoint
Dale Fye
external usenet poster
 
Posts: 2,651
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.