TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mel Jos
NA
3
0
Word Automation using C#
Feb 3 2010 11:48 PM
Hi All,
I need some urgent help about how to make only a portion of a paragraph be applied a particular style. I am using word automation using c# to generate a word document out of a MS word template file.
I tried the below method which is supposed to select between two bookmarks and apply the style to the selection.. But couldn't get it working..
The entire para gets applied with the style
object
oBMRangeStart =
"BMStart"
;
object
oRngBMStart = oDoc.Bookmarks.get_Item(
ref
oBMRangeStart).Range.Start;
object
oBMRangeEnd =
"BMEnd"
;
object
oRngBMEnd = oDoc.Bookmarks.get_Item(
ref
oBMRangeEnd).Range.Start;
Word.
Range
rngBM = oDoc.Range(
ref
oRngBMStart,
ref
oRngBMEnd);
rngBM.Select();
object
oStyleName =
"Style1"
;
rngBM.set_Style(
ref
oStyleName);
Any help will be greatly appreciated....
Thanks in advance...
Reply
Answers (
3
)
Could you please provide the C# for the VB code?
change brightness of image realtime