Board index » delphi » TWordApplication, problem with replacing text
kyro_sk
Delphi Developer |
TWordApplication, problem with replacing text2003-11-05 02:56:25 PM delphi126 I'm trying to write a simple program that replaces certain paragraphs with certain other paragraphs (legal memo's to be specific). My problem is: when I use the following function: // ************* procedure TdmMain.ReplaceField( const FieldName, Value: string ); var LFieldName, LValue, LTrue, LFalse, LWrapMode, LReplaceMode: OleVariant; begin LFieldName := FieldName; LValue := Value; LTrue := True; LFalse := False; LWrapMode := wdFindContinue; LReplaceMode := wdReplaceAll; msWord.ActiveDocument.Content.Find.Execute( LFieldName, LFalse, LTrue, LFalse, LFalse, LFalse, LTrue, LWrapMode, LFalse, LValue, LReplaceMode, EmptyParam, EmptyParam, EmptyParam, EmptyParam ); end; // ************* the program thows the following exception: --------------------------- String parameter too long. --------------------------- OK --------------------------- Breaking the replace paragraphs up would be a very messy fix. Does anybody out there know how to swap large text paragraphs with TWordApplication? Why can't I find any good solid reference about OLE Automation? Can anybody point me at a really good book? I'm sorta in a bind here as I'd like to get this finished by Friday, any help would be greatly appreciated. I know time is money - I appreciate it ! -Kyro (take off my pants to reply : ) |