Re: Inserting text into protected field/textbox by Doug
Doug
Mon Feb 12 03:30:59 CST 2007
I am not sure what you have in document x, but what you will need to do is
use code to open that document, then set a range object (say myrange) to the
range of that document then use :
ActiveDocument.FormFields("[bookmarknameofformfield]").Result = myrange
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"Mike" <Mike_Gator14@yahoo.com> wrote in message
news:1171269820.660532.308200@h3g2000cwc.googlegroups.com...
> On 12 feb, 05:28, "Doug Robbins - Word MVP" <d...@REMOVECAPSmvps.org>
> wrote:
>> If you use the .Result of the formfield, you can have insert text into it
>> without unprotecting the document.
>>
>
> Can you help me a little bit more? I now use:
>
> myName = formuliernaam.lsttekstblokselectie.List(x) & ".doc"
> ActiveDocument.Bookmarks("BInhoud").Select
> Selection.InsertFile FileName:=myName, Range:="", _
> ConfirmConversions:=False, Link:=False, Attachment:=False
>
> where x is the name of a wordfile, which has to be chosen in a
> userform listbox.
>
> If I use:
>
> myName = formuliernaam.lsttekstblokselectie.List(x) & ".doc"
> Set MyRange = ActiveDocument.Fields(15).Result
> MyRange.InsertFile FileName:=myName, Range:="", _
> ConfirmConversions:=False, Link:=False, Attachment:=False
>
> I get an error.
>
> Or is it not possible to use the InsertFile method with Fields.result?
>
> Thanks, Mike
>
>