+ Reply to Thread
Results 1 to 3 of 3

Make string bold?

  1. #1
    Adam
    Guest

    Make string bold?

    How do I make a string bold in VB code? I am trying to export to work, but if
    I make the bookmark bold it makes everything bold. This is because I have two
    bookmarks next to each other. I wish to know if there is a way to do it on
    the VB side as it's processing the bookmark:

    This is the code that I am using:
    x.ActiveDocument.Bookmarks("ExtScopePrep").Range.Text = String1 & vbCr &
    "Preparation as stated above" & vbCr 'Worksheets("Ext Quote").Cells(Row,
    2).Value & vbCr

    Thanks!!

  2. #2
    Don Guillett
    Guest

    Re: Make string bold?

    in the vbe, type in characters and touch the f1 key

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Adam" <[email protected]> wrote in message
    news:[email protected]...
    > How do I make a string bold in VB code? I am trying to export to work, but

    if
    > I make the bookmark bold it makes everything bold. This is because I have

    two
    > bookmarks next to each other. I wish to know if there is a way to do it on
    > the VB side as it's processing the bookmark:
    >
    > This is the code that I am using:
    > x.ActiveDocument.Bookmarks("ExtScopePrep").Range.Text = String1 & vbCr &
    > "Preparation as stated above" & vbCr 'Worksheets("Ext Quote").Cells(Row,
    > 2).Value & vbCr
    >
    > Thanks!!




  3. #3
    Tushar Mehta
    Guest

    Re: Make string bold?

    Turn on the macro recorder and then bold the desired text. Turn off
    the recorder and switch to the VBE for the code.

    It would appear you are doing the editing in Word. If so, you cannot
    select text once the macro recorder is turned on.

    An example of making the last 1/2 of the text in a document bold is:
    Sub testIt()
    With ActiveDocument
    .Range(.Characters.Count / 2, .Characters.Count).Font.Bold = True
    End With
    End Sub

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    > How do I make a string bold in VB code? I am trying to export to work, but if
    > I make the bookmark bold it makes everything bold. This is because I have two
    > bookmarks next to each other. I wish to know if there is a way to do it on
    > the VB side as it's processing the bookmark:
    >
    > This is the code that I am using:
    > x.ActiveDocument.Bookmarks("ExtScopePrep").Range.Text = String1 & vbCr &
    > "Preparation as stated above" & vbCr 'Worksheets("Ext Quote").Cells(Row,
    > 2).Value & vbCr
    >
    > Thanks!!
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1