Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Replacing the word content

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rams - 04 Sep 2007 13:46 GMT
I have created a 2007 addin using VSTO for office 2007 second edition, which
will add a custom pane and will retrieve the data from the sql server.

Now i have to add this data to the word document in a particular location. I
have tried using Bookmarks. But the value is appending in the bookmark. I
want to raplace the  content in bookmark. How to do it???

Thanks in advance.
Shauna Kelly - 05 Sep 2007 09:12 GMT
Hi Rams

At the simplest level, you need something like this:

   ActiveDocument.Bookmarks("MyBookmark").Range.Text = "My new text"

However, that will destroy the bookmark. If you need to retain the bookmark,
see
Inserting text at a bookmark without deleting the bookmark
http://www.word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> I have created a 2007 addin using VSTO for office 2007 second edition,
> which
[quoted text clipped - 6 lines]
>
> Thanks in advance.
Rams - 05 Sep 2007 11:20 GMT
Thanks. It works fine.

I have a table of 10 rows. In each row i have the bookmark. Is there any
other way for filling up the tables ???

> Hi Rams
>
[quoted text clipped - 22 lines]
> >
> > Thanks in advance.
Shauna Kelly - 07 Sep 2007 15:12 GMT
Hi

Yes, there are lots of ways for filling in tables. Can you give us some more
information about the nature of the data and what you're trying to achieve?

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Thanks. It works fine.
>
[quoted text clipped - 30 lines]
>> >
>> > Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.