Re: Want to programmatically Add formfields.
From: Jay Freedman (jay.freedman_at_verizon.net)
Date: 02/17/05
- Next message: Jay Freedman: "Re: need help creating macro to auto print"
- Previous message: RD: "RE: Suddenly a document modified in Word cannot 'save as' to a net"
- In reply to: Judi: "Re: Want to programmatically Add formfields."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Feb 2005 13:26:25 -0500
Hi Judi,
You can replace wdAllowOnlyFormFields with the value 2.
In Word's VBA editor, you can use the Object Browser to find the values of
VBA constants. (For completeness, the other valid values of Type are
wdAllowOnlyRevisions = 0, wdAllowOnlyComments = 1, and wdAllowOnlyReading =
3.) Depending on the language of the application you're writing, you could
use a #define or Const statement to declare the constant's value at the top
of your code and not have to change the Protect statement.
-- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Judi wrote: > I get a SYNTAX error when trying to compile my code on: > WordDoc.ProtectType:=wdAllowOnlyFormFields, NoReset:=True > > Again, I am accessing through OLE. Is there another way to pass these > properties? > Darn, I'm so close. > > > "Jay Freedman" wrote: > >> Hi Judi, >> >> There is a way to add more than 255 characters to a text form field. >> The technique is described at >> http://word.mvps.org/FAQs/MacrosVBA/SetLongFmFldResult.htm. >> >> Trying to add form fields at run time is just going to get you into >> deeper doodoo; don't go there. >> >> -- >> Regards, >> Jay Freedman >> Microsoft Word MVP FAQ: http://word.mvps.org >> >> Judi wrote: >>> I am sorry I am asking this question, but I have search until I'm >>> blue in the face for an answer. >>> I have an application which populates fields on a Template with data >>> from another application. >>> I read each field by doing a >>> >>> Forall bk in Worddoc.formfields >>> .....using formfield name find corresponding value in other >>> database, .... populate formfield by >>> WordDoc.FormFields(bk.Name).Result = fldValue Loop (next or >>> whatever) >>> >>> SOME of the fields in the other database contain text data that is >>> GREATER than 255 chars. The target formfield will not allow #chars >>> over 255. Unless there is a solution to this (we're on Office 2000) >>> I want to be able to dynamically Insert a number of formfields for >>> the extra characters AND I also want to be able to REMOVE all of >>> them (Except the 1st one) and Re-add them if the user reloads that >>> document. ( The document is a contract and therefore needs to be >>> updated with data from the database AND once modified, Re-updated >>> from the database.) >>> >>> I have also tried having a Start Formfield and an End Formfield and >>> just insert text after the first formfield. But when updating the >>> document I'm having trouble removing the text without remvoing the >>> form fields also. >>> >>> >>> I have tried bookmarks, but that doesn't work either. >>> >>> Assistance would be GREATLY APPRECIATED. >>> >>> Sincerely, >>> Judi Mohler >>> judimohler@mindspring.com
- Next message: Jay Freedman: "Re: need help creating macro to auto print"
- Previous message: RD: "RE: Suddenly a document modified in Word cannot 'save as' to a net"
- In reply to: Judi: "Re: Want to programmatically Add formfields."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|