473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VSTO Word Headers!

I am generating reports that require headers so I am setting up the headers
per http://msdn2.microsoft.com/library/ms178795.aspx.

I generate a string that contains my header data:

String strTest = “This is my Header”;

I then use the procedure shown in
http://msdn2.microsoft.com/library/ms178795.aspx to apply the header to the
document

foreach (Microsoft.Office.Interop.Word.Section wordSection in oDoc.Sections)
{
wordSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary]
.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.
wdAlignParagraphLeft;
wordSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary]
.Range.Text = strTest;
}

The question I have revolves around selecting text in the header. If I
wanted to change the header to be:

This is my Header

How would I go about selecting the words “is my” for bolding? I know that
for a document I can chose a range(ref ostart,ref ostop) and range.select()
to select the text that I want. But range(ref ostart,ref ostop) does not
seem to be available to me in
wordSection.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary]. There
is a Range.SetRange(int start,int stop) but after I use this command and then
a Range.Select() the entire header has been selected. Any help would be
appreciated.

Dec 7 '05 #1
0 1446

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Howard Kaikow | last post by:
I just visited the MSFT web site and saw the comparison/pricing of the different VS 2005 versions. I was looking for a statement of the system requirements for VS Pro and VSTO, could not find. ...
15
by: Enrique | last post by:
Question I am posting this question again (3rd time) because some issues with my no spam alias. Here it is the question: I have not been able to run unit tests for a VSTO (2005) project. I...
2
by: Le | last post by:
Folks, I'm trying to do some office automation using VSTO 2005. I've verified that ..Net Programmability Support is installed for every MS Office application and Microsoft Forms 2.0 .Net...
6
by: Ken Cox [Microsoft MVP] | last post by:
Hi folks, I need some help with an ASP.NET 2.0 page that generates the following error when it calls a VSTO runtime DLL: System.Security.SecurityException: That assembly does not allow...
5
by: Toulousse | last post by:
Hi, I'm currently a VB6 developer and I write mostly office type apps (not always Office though). At this point in time I have a project where I need to develop an add-in for Microsoft Project....
0
by: Hemangi | last post by:
hi friends, I have one problem with VSTO 2005. As I try to open new project using word document in VSTO 2005, I am getting error Specified cast is not valid...and the project is not opening.Please...
0
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
This is a duplicate of a posting on Officedev so apologies to anyone who's read this already. I had an Office add-in built in VB.Net 2003 with an Excel and a Word add-in class that transferred...
0
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
Hi, I have successfully developed and deployed VSTO add-ins for Excel, Word and PowerPoint 2003 using the VSTO templates and Visual Studio 2005. I want to install 2 or 3 of these add-ins in a...
1
by: renjucool | last post by:
I am working with Vsto 2005 to create word and outlook addins.Now i want to create an addin to generate a custom wizard template in word 2003.plz help me how to acheive this
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.