Results 1 to 2 of 2
  1. #1
    besuchanko is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    32

    Word Automation VBA: Make few words in range bold

    I am inserting text into a range using Word VBA automation. I want to only make some of the words in the range bold. How do I do this??



    Code:
        Set para4 = doc.Content.Paragraphs.Add
        para4.Range.InsertParagraphAfter
        para4.Range.Font.Size = "12"
        para4.Words(2).Font.Bold = True
        para4.Range.Text = "ACPE Activity:" & " #" & rst1![ACPE_P]
    I want just the words "ACPE Activity:" bold, and the rest not bold. I can't figure it out.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You might have better luck posting in a Word forum. But maybe a clue here http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    It shows code that sets a specific word in a range as bold.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automation to Word Crash
    By besuchanko in forum Programming
    Replies: 5
    Last Post: 03-02-2013, 08:54 PM
  2. Word Automation in Windows 7
    By tmbowden in forum Access
    Replies: 0
    Last Post: 01-23-2012, 01:17 PM
  3. Bold only certain words in textbox?
    By NateHaze in forum Reports
    Replies: 1
    Last Post: 06-04-2011, 11:47 AM
  4. Excel Automation Select Range Only with Data
    By orcinus in forum Programming
    Replies: 3
    Last Post: 02-09-2011, 01:03 PM
  5. Access and Word Automation
    By djreyrey in forum Forms
    Replies: 1
    Last Post: 01-08-2010, 02:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums