Re: Building Word documents using C#
- From: Andrew Mercer <akjmercer@xxxxxxxxxxx(donotspam)>
- Date: Thu, 7 Sep 2006 08:23:02 -0700
Hi,
Thanks - I was assuming (or perhaps hoping) that adding text at a bookmark
would overwrite the spaces rather than move them forwards.
I did think about trying to replace the text - however I assume this
requires replacing the correct number of empty spaces as well.
Thanks Again
Andrew
--
Andrew Mercer
-----------------
"Cindy M." wrote:
Hi Andrew,.
I think there's a misconception on your part about how Word documents
function...
If you add spaces between some text, then push more text in-between, the spaces
aren't removed.
You could use a two-column table to achieve the layout you describe.
You could set a left-aligned tabstop at the position of the second "column",
then press TAB at the end of the text in the first "column" (removing all the
spaces that are currently there)
You could place the text in the second "column" in a text box or a frame from
the Forms toolbar.
Which option to use depends very much on the end-use of the document. I suggest
you experiment a bit with these in the Word UI to determine which best meets
your needs.
I am building a word document using C# and Word .NET Programmability however
I have a question that I cannot find the answer for.
I have designed the Word template with embedded bookmarks.
When I build the document I dynamically place text at each book mark position.
The base document also has some other fixed text in it.
However in the completed document the original text is always moved.
EG:
Original document
MyText More MyText
Completed document
MyText [C# Added Text] More MyText
It seems that the original text is moved along a number of tab spaces
depending on the size of the text being added.
Is there anyway to prevent this so that the layout of the completed document
is the
same as the original (the only difference is the added text)?
I know that the spaces I left in the template are sufficient for the text I
want to add.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
- Follow-Ups:
- Re: Building Word documents using C#
- From: Cindy M .
- Re: Building Word documents using C#
- References:
- Re: Building Word documents using C#
- From: Cindy M .
- Re: Building Word documents using C#
- Prev by Date: Re: Building Word documents using C#
- Next by Date: Re: text-events in MS-Word ?
- Previous by thread: Re: Building Word documents using C#
- Next by thread: Re: Building Word documents using C#
- Index(es):
Relevant Pages
|