#DEFINE wdLine 5 LOCAL lcGifName, lcLogIn lcGifName = [] *** Find the Manager's login name in the users table lcLogIn = GETWORDNUM( gcManager, GETWORDCOUNT( gcManager ), [ ] ) IF SEEK( UPPER( ALLTRIM( lcLogIn ) ), [Users], [User] ) lcGifName = ADDBS( gcSysExe ) + [graphics\] + ALLTRIM( Users.user ) + [.gif] IF FILE( lcGifName ) *** we are good to go ELSE lcGifName = [] ENDIF && FILE( lcGifName ) ENDIF && SEEK( UPPER( ALLTRIM( gcManager ) ), [Users], [User] IF EMPTY( lcGifName ) lcGifName = ADDBS( gcSysExe ) + [graphics\Blank.gif] ENDIF && EMPTY( lcGifName ) *** Now we have to find the word sincerely, so that we know where to insert the gif WITH ThisForm.oWord.Selection WITH .Find .Text = "Sincerely" .Replacement.Text = "" .Forward = .T. .MatchCase = .F. .MatchWholeWord = .F. .MatchWildcards = .F. .MatchSoundsLike = .F. .MatchAllWordForms = .F. .Execute ENDWITH .EndKey( wdLine ) .TypeParagraph() *** Now insert the gif .InlineShapes.AddPicture( lcGifName, .F., .T. ) .HomeKey( wdLine ) ENDWITH