khu
05-02-2014, 11:20 AM
I'm trying to add a filepath to the title of an Excel chart. I simply want to keep the title the same and just append the filepath and then change the filepath formatting later.The original title has two lines, one a larger font and underlined. However, When execute the code:
with chtobj.chart.charttitle
.text = .text & vbCrLf & FilePath
end with
The new title gets blanketed with a default size and underline.
Original Title Format
Original Subtitle format
gets changed to
New Title Format
New Subtitle Format
Filepath
I've tried doing something like:
with chtobj.chart.charttitle
set OrigFont = .characters.font
.text = .text & vbCrLf & filepath
.characters.font = OrigFont
end with
but OrigFont updates to the new blanketed formatting when I change the title.
Is there a way to lock OrigFont so it doesn't update with the chart?
I'd like to be able to capture any formatting throughout the title, so I'm not sure a .character(start, len) type of formatting would work, as I don't know where bold, italics, underline, etc. would occur.
Any help is appreciated, thanks!
Khu
with chtobj.chart.charttitle
.text = .text & vbCrLf & FilePath
end with
The new title gets blanketed with a default size and underline.
Original Title Format
Original Subtitle format
gets changed to
New Title Format
New Subtitle Format
Filepath
I've tried doing something like:
with chtobj.chart.charttitle
set OrigFont = .characters.font
.text = .text & vbCrLf & filepath
.characters.font = OrigFont
end with
but OrigFont updates to the new blanketed formatting when I change the title.
Is there a way to lock OrigFont so it doesn't update with the chart?
I'd like to be able to capture any formatting throughout the title, so I'm not sure a .character(start, len) type of formatting would work, as I don't know where bold, italics, underline, etc. would occur.
Any help is appreciated, thanks!
Khu