Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Bolding certain text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Curry - 26 Oct 2007 23:40 GMT
Hi all, I'm trying to create a small VB code that allows us to save decisions
in a singe document.  I have 3 text boxes that we'll fill out (problem,
decision, and decider) and when you hit the command button it will insert the
information below any previous decisions that have been recorded.

The issue is that I would like to enter in "Problem Description:   " &
strProblem but have Problem Description be entered as bold (for readability)
and for the LIFE of me I can't find where to set this.  I've tried entering
it in as a lone paragraph and setting that range to bold and Word doesn't
like it.  I wish I could just find the text and bold it but I can't figure
that part out.

I'm on Word 2003 and using the Visual Basic Editor for my code.  Any help is
GREATLY appreciated.
Helmut Weber - 27 Oct 2007 10:23 GMT
Hi Ryan,

something along these lines:

Sub Macro8()
Dim s As String
s = "xxxxxxxxxx: "
With Selection
  .Collapse
  .Bookmarks.Add "bold"
End With
With ActiveDocument.Bookmarks("bold")
  .Range.Text = s
  .End = .End + Len(s)
  .Range.InsertAfter "yyyy"
  .Range.Font.Bold = True
  .Delete
End With
End Sub

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.