473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Offi ce.Interop.Word .Section wordSection in oDoc.Sections)
{
wordSection.Hea ders[Word.WdHeaderFo oterIndex.wdHea derFooterPrimar y]
.Range.Paragrap hFormat.Alignme nt = Word.WdParagrap hAlignment.
wdAlignParagrap hLeft;
wordSection.Hea ders[Word.WdHeaderFo oterIndex.wdHea derFooterPrimar y]
.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.Hea ders[Word.WdHeaderFo oterIndex.wdHea derFooterPrimar y]. 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 1455

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

Similar topics

13
1938
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. Also, more details on the differences between VS Pro and VSTO. For example, can VSTO be used to create a DLL, in particular, a DLL that can be used as an ActiveX DLL with Office? In VSTO, other than the addition of the support for Office 2003...
15
6938
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 have an Excel project and a unit test project in the same solution. I have not found the way to initialize the runtimecallback as required by the code generated
2
2793
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 Programmability Support is also installed under Office Tools through Office Setup. I've then installed VSTO 2005 (vstor.exe, http://www.microsoft.com/downloads/details.aspx?familyid=f5539a90-dc41-4792-8ef8-f4de62ff1e81&displaylang=en). After installing...
6
2000
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 partially trusted callers. My understanding was that for my partial-trust Web application to call a VSTO strong-named assembly, the assembly needs to be in the GAC. That is,
5
1583
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. There appears to be two paths I can go down, VS.NET or VSTO. From what I have read, VSTO is the tool if you are planning on developing an Office Application, but only if it is Excel, Word, Outlook or InfoPath and
0
1231
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 help me to solve this problem.
0
1307
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 data from Excel to Word using the clipboard. It worked well until I developed a new version using VS 2005 and VSTO (the Excel and Word add-ins are now separate DLLs). Now I find that after placing data on the clipboard using the Excel.Range.Copy...
0
1467
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 single Installer package but am finding this inexplicably challenging. If I add the Visual Studio project output of the Excel add-in to the setup project for the Word add-in, adding the necessary files, registry entries and a custom actions to set...
1
1221
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
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.