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 / February 2006

Tip: Looking for answers? Try searching our database.

Insert textfile into formfield

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 16 Feb 2006 16:27 GMT
I am using Office XP.

Can someone please assist me with some code which with a case statement as
below picksup a value from another formfield and selects the appropriate text
file which is an address and places it in a formfield wrapping round the rows
of text?

I have tried various suggestions but to no avail!

Sub CrimeNo()
Dim strDivision As String

strDivision = Left(ActiveDocument.FormFields("CrimeNo").Result, 2)

Select Case strDivision

Case "EA"

'Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldIncludeText, _
'Text:="H:\\Victims Code\\EA.txt", PreserveFormatting:=False

'ActiveDocument.FormFields("Address").Select _
'Selection.TypeText Text:="H:\\Victims Code\\EA.txt"

'ActiveDocument.FormFields("Address").Select _
'Selection.Range.Text , Type:=wdFieldIncludeText, _
'Text:="H:\\Victims Code\\EA.txt", PreserveFormatting:=False

Case Else

End Select

Thanks

Signature

Mark

Cindy M  -WordMVP- - 28 Feb 2006 18:13 GMT
Hi Mark,

In order to insert a field you will need to remove the document protection,
first. After inserting the field, you reimplement the protection. The basic code
for that you'll find in the Forms section on my website.

> I am using Office XP.
>  
[quoted text clipped - 27 lines]
>  
> End Select

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)

Rate this thread:






 
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.