Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Excel to Word Font Size

Hoping that someone has done this before.

Trying to populate a Word Bookmark with text from Excel.

This works:
Set wordRange = wordDoc.GoTo(What:=wdGoToBookmark, Name:="ltrA")
wordRange.InsertAfter "A"

Now what I'd like to do is set the font on the word document for this
bookmark
to bold. I know that I can have the bookmark in Word preformatted to
bold
but I'd rather be able to do it on-the-fly.
Is this possible?
Are there other formats that can be set, like Underline?

Thanks,
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Excel to Word Font Size

Peter,

That worked!!!!
I was trying this from the wrong angle by things like
Name:="ltrA", Font.Bold:=True
which obviously wasn't working.
After reading your reply, I realized that the
"Set wordRange =" already had me where I needed to be.

For the record, the following worked like a charm:

Set wordRange = wordDoc.GoTo(What:=wdGoToBookmark, Name:="ltrB")
wordRange.Characters(1).Font.Bold = True
wordRange.Characters(1).Font.Underline = True
wordRange.InsertAfter "B"

Thanks,
John


Peter Beach wrote:

Hi John,

I think the Word object model is horrible (and that's mainly because I can
never get it to work properly <g) but how about trying something like:

wordRange.Characters(2).Font.Bold = True

If that works (untested), the Font property has a number of other attributes
like underline etc.

Good luck (always my advice on Word VBA <g),

Peter Beach

"John Wilson" wrote in message
...
Hoping that someone has done this before.

Trying to populate a Word Bookmark with text from Excel.

This works:
Set wordRange = wordDoc.GoTo(What:=wdGoToBookmark, Name:="ltrA")
wordRange.InsertAfter "A"

Now what I'd like to do is set the font on the word document for this
bookmark
to bold. I know that I can have the bookmark in Word preformatted to
bold
but I'd rather be able to do it on-the-fly.
Is this possible?
Are there other formats that can be set, like Underline?

Thanks,
John


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
Excel font size changes Steve H Excel Discussion (Misc queries) 1 May 30th 06 11:27 PM
My tabs' font size is smaller - how do I restore default size? katykins53 Excel Discussion (Misc queries) 1 January 11th 06 12:07 AM
Font size prints same size regardless of how I set it in Excel Marcusmouse Excel Discussion (Misc queries) 2 May 26th 05 03:25 PM


All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"