Re: powerpoint automation via vb.net
- From: bikash <bikash@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 7 May 2007 09:20:01 -0700
If you look into my code finding the text in between # is taken care of. if
you print strword it prints all the text between # one by one.
in below code, it sends the entire string in s to textFrame
ppItem.TextFrame.TextRange.Text = s
so I dont know how to make it bold in my if statement where i am doing
msgbox(strword).
please help
"Steve Rindsberg" wrote:
.
I'm not a .Net user so I can't speak for it. But it looks like you're stepping
through the string to find the start and stop positions marked by #-marks.
Knowing that, you could do this in VBA:
lLength = (lEndPoint - lStartPoint) + 1
.TextFrame.TextRange.Characters(lStartPoint, lLength).Font.Bold = True
In article <0583EE31-C2CA-41CF-AC62-8B6CE77D932D@xxxxxxxxxxxxx>, Bikash wrote:
Hi I am sending a list of records to each textbox in powerpoint. for each
text box if i find any text tahts in between # i need to make them bold. e.g.
"I want #this# bold."
here "this" should be bold when interpreting in powerpoint.
below is the code where i am able to capture the text thats in between #.
The problem is i want only selected text bold and rest normal.
Dim ppItem As Microsoft.Office.Interop.PowerPoint.Shape
If Len(Trim(dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text),
Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1)))) > 0 Then
Dim s As String =
dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text),
Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1))
s = s.Trim
ppItem.TextFrame.TextRange.Text = s
'ppItem.TextFrame.TextRange.Font.Bold =
Microsoft.Office.Core.MsoTriState.msoFalse
'========================
Dim a, b, looplen As Integer
looplen = s.Length
Dim hashWords As String()
Dim strWord As String
For a = 0 To looplen - 1
If s.Substring(a, 1) =
"#" Then
a += 1
For b = 1 To looplen
- 1
If
s.Substring(a, 1) = "#" Then
'MsgBox(strWord)
ppItem.TextFrame.TextRange.Font.Bold =
Microsoft.Office.Core.MsoTriState.msoCTrue
Else
ppItem.TextFrame.TextRange.Font.Bold =
Microsoft.Office.Core.MsoTriState.msoFalse
strWord = ""
Exit For
End If
strWord +=
s.Substring(a, 1)
a += 1
Next
Else
ppItem.TextFrame.TextRange.Font.Bold =
Microsoft.Office.Core.MsoTriState.msoFalse
End If
Next
In above code i want all the strings send to powerpoint and make strWord bold.
could someone please help me or just give me a clue I am having really hard
time to fix it
thanks
--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
- Follow-Ups:
- Re: powerpoint automation via vb.net
- From: Steve Rindsberg
- Re: powerpoint automation via vb.net
- References:
- powerpoint automation via vb.net
- From: bikash
- Re: powerpoint automation via vb.net
- From: Steve Rindsberg
- powerpoint automation via vb.net
- Prev by Date: Re: powerpoint automation via vb.net
- Next by Date: Re: powerpoint automation via vb.net
- Previous by thread: Re: powerpoint automation via vb.net
- Next by thread: Re: powerpoint automation via vb.net
- Index(es):
Relevant Pages
|