+ Reply to Thread
Results 1 to 9 of 9

Formatting letter in Word created from Excel VBA?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Unhappy Formatting letter in Word created from Excel VBA?

    Hello all,

    I'm new to manipulating Word from Excel. I recently have need for it and have made an attempt. Below is what I have so far. Please run it and refer to the Word doc produced when reading the next few questions.

    How do I:
    • ...make the underline in the subject line across all the words (rather than word by word)?
    • ...turn off the underline format afterwards?
    • ...create a bullet point list (at "something something")?

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Formatting letter in Word created from Excel VBA?

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Formatting letter in Word created from Excel VBA?

    Brilliant! That fixed it, Thanks!

    Do you know of any good web page that covers this topic (manipulating Word documents from Excel)?

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Formatting letter in Word created from Excel VBA?

    You're welcome.

    I don't know a good site. I just do a web search for something like VBA Underline paragraph, but the results are very hit or miss.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Formatting letter in Word created from Excel VBA?

    Round 2 of Word formatting problems!

    Does anyone know how to:
    • ...add text as hyperlink? (Say in the email address at the bottom of the address box)
    • ...change the text font colour?
    • ...add highlighting to text?



    UPDATE: I think I have solved the text colour
    Please Login or Register  to view this content.
    Can anybody assist with either the hyperlink or highlighting?
    Last edited by mc84excel; 04-07-2013 at 08:17 PM.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Formatting letter in Word created from Excel VBA?

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Formatting letter in Word created from Excel VBA?

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Thanks again AlphaFrog.

    Two questions:
    1. How do I fully implement the hyperlink? Hover over the hyperlink and use 'Ctrl + Click' to see what I mean. The address isn't valid - it tries to open a file rather than the dummy email address.
    2. Would it be possible to have the font colour and/or highlighting applied conditionally? For e.g. how would I change the font to red on inpCltNmePrincipalEmail only if inpCltNmePrincipalEmail = "Enter Email Address"?

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Formatting letter in Word created from Excel VBA?

    1) I got this syntax from recording my steps in a macro in MS-Word.
    .Hyperlinks.Add .Range, "MailTo:" & inpCltNmePrincipalEmail, , , inpCltNmePrincipalEmail

    2) I'm not sure what you're asking but use an If statment then set the font color red or not.

  9. #9
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Formatting letter in Word created from Excel VBA?

    Quote Originally Posted by AlphaFrog View Post
    1) I got this syntax from recording my steps in a macro in MS-Word.
    .Hyperlinks.Add .Range, "MailTo:" & inpCltNmePrincipalEmail, , , inpCltNmePrincipalEmail

    2) I'm not sure what you're asking but use an If statment then set the font color red or not.
    Thanks. Both remaining problems solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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