Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 23rd, 2003, 08:49 AM
tOeJaM tOeJaM is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: United States
Posts: 46 tOeJaM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 55 sec
Reputation Power: 6
Writing to bookmarked fields

Need some help writing to bookmarked fields from VB to MSWord.

More specifically - I have bookmarked fields in a MS Word document and I need to write to these fields via ADO. Is the following the only way to accomplish this task?

myDoc.Bookmarks("field1").Select
Selection.Text = Trim(rs("field1").Value)

I'm sure there is a better way to handle this, I'm new at this vba stuff so bare with me. Thanks in advance.

Reply With Quote
  #2  
Old July 23rd, 2003, 08:59 AM
tOeJaM tOeJaM is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: United States
Posts: 46 tOeJaM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 55 sec
Reputation Power: 6
Writing to a bookmarked field

Or is this a better way to handle writing to a bookmarked field?

myDoc.Variables("field1").Value = Trim(rs("field1").Value)

Reply With Quote
  #3  
Old July 23rd, 2003, 04:18 PM
tOeJaM tOeJaM is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: United States
Posts: 46 tOeJaM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 55 sec
Reputation Power: 6
Thumbs up Writing to Bookmarked fields

To answer this question, I guess I figured it out myself.

myDoc.Bookmarks("field1").Select
Selection.Text = Trim(rs("field1").Value)

Seems to be the most effective way to handle this.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Writing to bookmarked fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway