Results 1 to 2 of 2

Thread: Write a string to a field in a protected word doc

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23

    Write a string to a field in a protected word doc

    I've coded up a routine that opens up a protected word document containing text entry fields. The problem is when i try to write a string to the entry field. At the moment i move to the bookmark then try to enter text to the current selection.

    I get an error saying that the program is trying to write to a protected area of the document.

    <vb>
    wSourceDoc.GoTo What:=wdGoToBookmark,name:="CompanyProfile"

    wApp.Selection.TypeText Text:="my string"
    </vb>

    I just want to set focus to the field then populate the field with the text string.

    any ideas

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23

    its ok, however

    figured it out, however, my field is limited to 750 chars in the receiving document. When i try to assign a string of length 700 chars i get a message saying 'string too long' error: 4609

    i'm doing a trim and even a left(<var>,750) etc and its not helping. If i simply hard-code a value, i.e. "test value" it works ok.

    completely puzzled by this, has anyone seen this behaviour before?]

    thanks

    john

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width