ࡱ                >  	               Z          [          Y   ܥh W	T  e                ±                                                                                           H      H      H      H      H                H      @  C   H     L      L      L      P      T      T      T                        8   J     6     "       X   ۦ  ,   @                            T        J K   P     T                      T      T      @      ^                  L                      H      ^      ^      ^      T  
        L           P      ,  \           0FXƿ2     :                             T            ^    ^                                                                                             .A   dAiGetModuleHandleNjkerneliname$4CdAiWinExecNjkerneliCmd4FishowCmd4C4CdAiSetHandleCountNjkerneliCnt4C4Cddp: ---------------------------------------------------------dp Test subroutinedp0 	use the WordBasic Debugger the check this codedp: ---------------------------------------------------------ddiMAINdRiFcode$jDBGdRiMask$ggjDBG: Enter Filemask:ititle$j dRiNgiMask$gl dRiNl  iMask$giMask$iNl dRiLevel$gjDBG: Enter Level:ititle$j5dRiNgiLevel$gl dRiNl  iLevel$giLevel$iNl dRdRiApplication$gMjApplicationdRiObject$gMjObjectdRiTitle$jSAP R/3dRiRtfFile$jsap.rtfRdRiChan$gMjDDE-ChannelddRiApplication$j iChan$j dog+jConnection not initializediTitle$l0 doichan$j do*ierrdRTddRiChannelgiChan$ddRgiApplication$l  dog+iApplication$j is not running (iFcode$j,iFlags$j)iTitle$l0 do*ierrdRTdRdRi	Argument$iLevel$j||iMask$dR6j	Execute: (iFcode$(j,(i	Argument$ddQRg`iChanneliFcode$i	Argument$ddRgcjMicrosoft Wordl ddR*iexitdeerrdRp ERROReexitdddp: ---------------------------------------------------------dp Call R/3 Function Call  dp dp dp Arguments:	dp7 	Fcode$: the function code, see interface description dp				in transaction SE37dp,		Flags$: flags, which data should be passeddp/				S: 	save document in RTF format to tmp-filedp"					before executing the RFC calldp*				I:  insert the string returned in the dp)					StringToInsert field at the current dp					positiondp(				C:	copy the exported table from the dp(					Lines field at the current positiondp				E:  exit worddp: ---------------------------------------------------------dd/0RiApplication$d/0RiObject$d/0RiTitle$d/0RiStartCommand$d/0RiRtfFile$dodiExecuteiFcode$iFlags$dR6njR3WinSvr::Execute((iFcode$(j,(iFlags$(j)dddp( TEST: normaly the prg should abort heredp. TEST		If WinExec(StartCommand$, 0) <= 32 Thendp; TEST			MsgBox("Cannot start " + StartCommand$, Title$, 48)dp TEST			Goto exitdp TEST		EndIfdp' TEST		Connect(Application$, Object$) 	dp1 TEST		Chan$ = AbrufenDokumentVar$("DDE-Channel")dddRgjTEMPj doiEnv$gjTEMPdRgjTMPj doiEnv$i
Umgebunng$jTMPdR doiEnv$jC:\dRTdRdRg	iEnv$l j\doiTmpFile$iEnv$iRtfFile$dR doiTmpFile$iEnv$j\iRtfFile$dRTddRi	SaveFlag$j ddRgl iFlags$jSl  doi	SaveFlag$jXdQoiOriginalFile$g%l  dogT s iTmpFile$s l s l  s` j sUl  sj sl  sl  sl  sl  ddogT s iOriginalFile$s l  s l  s` j sUl  sj sl  sl  sl  sl  dRdRTddQRiMarkedString$grgogpddRiStringSeparator$j|dRiFcode$jDBGdoi	Argument$iFlags$dR doi	Argument$i	SaveFlag$iStringSeparator$iTmpFile$iStringSeparator$iMarkedString$dRTdR6j	Execute: (iFcode$(j,(i	Argument$dQRg`iChanneliFcode$i	Argument$ddRgl iFlags$jIl  do6j	Request: (jStringToInsertdoiStringToInsert$gaiChanneljStringToInsertdo6jInsert:(iStringToInsert$dogiStringToInsert$dRTddRgl iFlags$jCl  do6j	Request: (jTmpFiledoi
Newcursor$gaiChannelj	Newcursordoi
Newcursor$jXdoiTmpFile$gaiChanneljTmpFiledoitmpfile$j dog+jCannot get tmpfileiTitle$l0 do*iexitdoTdo6j	Include: iTmpFile$ddog s iTmpFile$sIl  s l  do do6jNo changed from R/3doTdRTddRiChan$j do6j
Termnate: (iChanneldog]iChanneldRTddp# TEST	DDEExecute(Channel, "[TEST]")ddRgl iFlags$jEl  do6jClose: (g%l  doi
Disconnectdogրl dogl dogրl  ddop If ZhlenFenster() < 1 Thendop	DateiBeenden 1dop EndIfdRTddR6jO.K.ddR*iexitddp7 ------------ Error exit ------------------------------eerrdRiMessage$jCannot execute macro, error giErrdRg+iMessage$iTitle$l0 dR6jTerminate AlldRg^ddp7 ------------ Normal exit -----------------------------eexitdddp7 ======================================================dp" Init connection to server programdp7 ------------------------------------------------------ddiConnectiAppl$iObj$ddR6jR3WinSvr::Connect ((iAppl$(j,(iObj$(j)ddRgiApplication$l  dog+iApplication$j is not runningiTitle$l0 doiChan$j do*ierrdRTddRiSetHandleCountl2 ddRgjMicrosoft Wordj
DDETimeOutj1200jWINWORD6.INIddRgLjApplicationiAppl$dRgLjObjectiObj$ddRl do6j
Initiate: (iAppl$(j,(iObj$doiChannelg\iAppl$iObj$doiChan$giChanneldogLjDDE-ChanneliChan$dRTddRiOrgDotPath$gjMicrosoft WordjORG-DOT-PATHjWINWORD6.INIdRiOrgDotPath$j dogjMicrosoft WordjUSER-DOT-PATHiOrgDotPath$jWINWORD6.INIdopM SetPrivateProfileString "Microsoft Word", "ORG-DOT-PATH", "", "WINWORD6.INI"dRTddRgCjMicrosoft WorddRgcjMicrosoft Wordl ddR*iexiteerrdeexitdddp7 ======================================================dp Release connectiondp7 ------------------------------------------------------ddi
DisconnectddR6jR3WinSvr::Disconnect ddRiChan$gMjDDE-ChanneldRiApplication$gMjApplicationddRgiApplication$l  dog+iApplication$j is not runningiTitle$l0 doiChan$j do*ierrdRTdddRiChan$j doiChannelgiChan$do6jTerminate: (iChanneldog]iChanneldRTdRdRgAjMicrosoft Wordl ddR*iexitdeerrdeexitd dk4----------------------------------------------------dk	NAME 	:  R3Docdk dk6   COMMENTS:  The functions and subroutines available dk.				in this macro are accessable by customizeddk				templates.dk dk9			   All of them deal with the document representation. dk dk	 History:dk			   08/09/96	A-00244dk!				Save the default Font & Size dk              08/09/96 A-00245dk-				Build function to save and to restore thedk				current page layout	dk%				Document variable used : PageViewdk dk              15/09/96 A-00245dk0				Build function SaveNormalFont. This functiondk"				is called at document creationdk7               Document variable used = NormalFont     dk									 &   SizeNormalFontdk              dk dk4----------------------------------------------------diMAINdRg+j2Last modification on : 15/09/96. A-00245 & A-00244jRELEASEDl@ dRiSavePageViewdRiSaveNormalFontdniSetDefaultFontdniRestorePageViewddk4----------------------------------------------------dk dk 					InitOrgProtectiondk dk	DATE : 28/05/95dk4----------------------------------------------------dk dk3   This function save the orginal protection. This dk;   function must be call at the beginning of the process   dk0 SetDocumentDirty  0   ' The document is cleaneddk dk   17/07/96  A-00233dk0        The type of word is tested if word 7.00 dk0        DocumentProtection(). what do we do withdk,        other type of WORD !!! We should putdk,        the protection value in the documentdk dk6------------------------------------------------------diInitOrgProtectiondRiProtectg+RdRiProtectnl  g	dRgLjOrgProtectiongiProtectdng$nl  nk The document is cleaneddddddiSetOrgProtectiondRiOrgProtect$gMjOrgProtectiondRiOrdProtngiOrgProtect$dRg$nl  nk The document is cleaneddn13iOrdProtdo3l nk Formdogs l sl do3l nk Annotationdogs l do3 nk NothingdodR1dddk4----------------------------------------------------dk dk 					IsDisplaydk dk	DATE : 20/12/95dk4----------------------------------------------------dk dk*   This function return TRUE ( -1 ) if thedk-	document has been selected to be in display dk   modus only.    dk dk	dk4----------------------------------------------------di	IsDisplaydoiBack$i
R3VariablewGet$jDisplaydogiBack$jXndni	IsDisplayl do doni	IsDisplaynl  RdoTdddk4----------------------------------------------------dk dk 					Deletedk dk	DATE : 21/12/95dk4----------------------------------------------------dk dk1 	Signal to the server that the document has beendk
   deleteddk	dk4----------------------------------------------------di	DeleteDocdRiChanneliR3WinSrvv
GetChanneldRg_iChanneljdeleteddk4----------------------------------------------------dk dk 					Changedk dk	DATE : 22/12/95dk4----------------------------------------------------dk dk1 	Signal to the server that the document has beendk
   changeddk	dk4----------------------------------------------------di
HasChangeddRiChanneliR3WinSrvv
GetChanneldRg_iChanneljchangedddk4----------------------------------------------------dk dk 					SavePageViewdk!                & RestorePageViewdk dk	DATE : 08/09/96dk4----------------------------------------------------dk dk/ 	Save in the document variable 'PageView' the dk   current page view.dk6   If the document is protected we do nothing as a setdk,   variable will generate a word basic errordk 	dk4----------------------------------------------------diSavePageViewdQg+l  dRgsQRgLjPageViewgl dRgugLjPageViewgl dRgtgLjPageViewgl dRggLjPageViewgl dRg$nl  dQTdddiRestorePageViewdQg+l  dni	FirstViewggMjPageViewdRi	FirstViewl gsdRi	FirstViewl gudRi	FirstViewl gtdRi	FirstViewl gdRgLjPageViewj dRg$nl  dQTddddk4----------------------------------------------------dk dk 					SetDefaultFontdk dk	DATE : 08/09/96dk4----------------------------------------------------dk dk2  Set the default font for all SAP Document as we dk1  do not add it to the template we do not need todk0  set back the original. We set this value when dk/  we do a mail merge as the translation use thedk  fontdk 	dk4----------------------------------------------------diSetDefaultFontdg+l  diFontToRestore$gMj
NormalFontdiSizeFontToRestore$gMjSizeNormalFontddiFontToRestore$j niSizeFontToRestore$j dRg s jNormals| jNormals l  s, dRg s" iSizeFontToRestore$s( l  s# l  sl  sl  sl  s' l  s] l  s;l  s- j s+ j sl  sj sj0s! iFontToRestore$s$ l  s% l  s) l  sl  dTdTddddk4----------------------------------------------------dk dk 					SetDefaultFontdk dk	DATE : 15/09/96dk dk.   WARNING: This function is country dependantdk4----------------------------------------------------diSaveNormalFontddg+l  dRg s jNormals, dR/iCurFontValue4g dR>niCurFontValuedRgLj
NormalFontniCurFontvalues! dngLjSizeNormalFontnniCurFontvalues" dRg$nl  dTdd diMAINddgP s j C:\TEMP\TAB.TXTddg ddg sj1sjAutos j0sj167ddgT s jTAB.RTFs l ddddiGenerateiTextTab$iDestTab$dd dpB -----------------------------------------------------------------dp dp dp
	History :dp dp>		23/10/95 - A-00099. WORDMACRO Error the document is already dp-				   closed and we want to access variablesdp dp6		26/01/96 - Subproject SHE DotFile in OpenDocument isdp				   is optionaldp dp9		21/03/96 - A-00188. The document protection is not set dp6				   in display mode. The Released message has been dp				   addeddp dpB     04/04/96 - For SHE. In OpenDocument. Back from R3OpenDocumentdp>                the actif document is no the original one !!!!dp dp>		12/04/96 - The SHE correction creates a problem. Be careful dp   			 with the testsdp dp;     28/05/96 - A-00216 - When a document is in Modus form dp3  			protection we have an error to load the file. dp'				Modification in R3WsWinsrv as well dp dp<     03/06/96 - A-00219 - Where the document is in protecteddp8              mode the document should be set as clean. dp dp     23/12/96  - A-00318. dp?                  On Windows 95 or Window NT when the option nodpL                  extension is used then the document could not be protecteddp$                  in display modus. dp dp=		25/05/2000	GB25052000, Gerd Balzuweit, Use the style of thedp					given template.dp dpB -----------------------------------------------------------------diMAINdRg+j(Last modification on : 23/12/96. A-00318jReleasedl@ dddpB -----------------------------------------------------------------dp Set R/3 Language Variabledp3 	DocFile$ : Full name of the Word-document to opendp< 	dotfile$ : Basename of the dot-file (with extension .dot)	dp0					language joker '%' is subs. by the current dp					language dp				  OPTIONAL dp dp,		DocProt$  :  OPTIONAL still used by officedp dpB -----------------------------------------------------------------diOpenDocumentiDocFile$iDotFile$iDocProt$ddRgP s iDocFile$dRk dRk* Test if some kind of original protection dRk dRiDocProt$j dog	dRTdRdRgLjDocProtectioniDocProt$dRk dRk/   A-00216 . No the protection should be removedRk dnk  R3Doc.InitOrgProtection()dnRiDotFile$j doiDotPath$ggl doiNewDot$i	BuildDot$iDotPath$iDotFile$jDddok% Use the style of the given template.dok GB25052000dok MsgBox NewDot$dogW sR iNewDot$s'l dnTdRk  Call user macrodRgĀjR3OpenDocumentdo)iR3OpenDocumentdRTdnddRp7 ----------------------------------------------------- dRp6 A-00099. When print with SAPMS_FORM_EDIT the documentdRp% is already closed at this point !!!!dRp5 So we scan if the document is still open then we do dRp the normal processdRp6 -----------------------------------------------------dRiDocName$n	giDocFile$l dRiNumbWindowsng:ddR#iCurDocl $iNumbWindowsRdnkG A-00188 & A-000318 The extension is removed of the name of the windowsdnk  this should happendni
NameOfWin$nng;iCurDocdniFoundExtensionnngi
NameOfWin$j.dniFoundExtensionl  doQi
NameOfWin$gi
NameOfWin$iFoundExtensionl dnTdnk  dnk0  Now we compare with the file without extensiondRk     dngi
NameOfWin$ngiDocName$RdRnp A-00197dnRgbg;iCurDocddoiDocProt$gMjDocProtectiondRndog$l  doiR3Docv	IsDisplaydogs l do doiDocProt$j doiModegiDocProt$dogs imodesl dn dok dok  A-00216 . No only for Word 7.00dn k dok R3Doc.SetOrgProtection				doTdoTddo*i
EndOpenDocdRndR&iCurDocde
EndOpenDocddddpB -----------------------------------------------------------------dp  Set R/3 Language Variable rem 	dp3 	DocFile$ : Full name of the Word-document to opendp< 	dotfile$ : Basename of the dot-file (with extension .dot)	dp8					language joker '%' is subs. by the current lenguagedpB -----------------------------------------------------------------diActivateDocumentiDocFile$iDotFile$ddRiDocProt$gMjDocProtectiondRiDocDirtyg#ddnR,-*iProtectionOffdndRg	ddp 	If DocProt$ = "" Thendp$ 		Dim Dlg As ExtrasDokumentSchtzendp 		GetCurValues Dlgdp 		DocProt$ = Str$(Dlg.Art)dp9 		DokumentVariableBestimmen("DocProtection", DocProt$)		dp 	EndIfddR*iProtectionResumedeProtectionOffdRgLjDocProtectionj deProtectionResumedR,-*l  dRiR3WinSrvv	ReconnectiDocFile$j dodRiDotPath$ggl dRiNewDot$i	BuildDot$iDotPath$iDotFile$jDddRgW sR iNewDot$ddRgĀjR3Reconnectdo)iR3ReconnectdRTddRiDocProt$gMjDocProtectiondRdRg$iDocDirtyddniR3Docv	Isdisplaydogs l dRQ doiDocProt$j doiModegiDocProt$dogs iModesl doTdRTdddddddpB -----------------------------------------------------------------dp Set R/3 Language Variabledp3 	DocFile$ : Full name of the Word-document to opendp< 	dotfile$ : Basename of the dot-file (with extension .dot)	dp!					language joker '%' is subs. dpB -----------------------------------------------------------------diNewDocumentiDocFile$iDotFile$ddR6jSAP R/3: Create new document (iDocFile$(j, use template (iDotFile$ddRiType$g	iDocFile$l dRgiType$jRTFdoiFmtl dRgiType$jDOCdoiFmtl  dR doi	ErrorExitjIllegal document type: iType$iErrdRTddRiDotPath$ggl dRiNewDot$i	BuildDot$iDotPath$iDotFile$jDddRgO sR iNewDot$dRgT s iDocFile$s iFmtddRgLj	IsNewFilej1ddRgĀjR3NewDocumentdo)iR3NewDocumentdRTdddddpC ------------------------------------------------------------------dp GetLanguage$dp1		return: the current winword-language (one char)dpC ------------------------------------------------------------------dddiGetLanguage$ddRi	WordLang$gl ddRgi	WordLang$l jDeutschdoiR3Lang$jDdRgi	WordLang$l jEnglishdoiR3Lang$jEdRgi	WordLang$l jFranaisdoiR3Lang$jFdRgi	WordLang$l
 j
NederlandsdoiR3Lang$jNdRgi	WordLang$l jItalianodoiR3Lang$jIdRgi	WordLang$l jNorskdoiR3Lang$jOdRgi	WordLang$l	 j	PortugusdoiR3Lang$jPdRgi	WordLang$l jEspaoldoiR3Lang$jSdRgi	WordLang$l jDanskdoiR3Lang$jKdR doiR3Lang$jDdoiDbgl  6jUnknown WinWord Language (g~(j, use (iR3Lang$dRTddRiGetLanguage$iR3Lang$ddddpC ------------------------------------------------------------------dp
 ChangeDotdp5		OldDotFile$:	full name of the old document templatedpB		NewDotFile$:	basename (with ext. and lang. joker) of the new dotdpC ------------------------------------------------------------------ddi	ChangeDotiOldDotFile$iNewDotFile$ddRiNewDotFile$j doi	ErrorExitjNewDotFile missingl  dRTddRiDotPath$ggl dRiNewDot$i	BuildDot$iDotPath$iNewDotFile$jDddRgiNewDot$giDotPath$iOldDotFile$dogW sR iNewDot$dRTddddpC ------------------------------------------------------------------dp	 BuildDotdp		DotPath$ : Dir. of SAP-Dot'sdp2		DotFile$ : basename w. ext. of document templatedp<		DefaultLang$ : language used, if current dot ist not founddpC ------------------------------------------------------------------ddi	BuildDot$iDotPath$iDotFile$iDefaultLang$ddRgiDotFile$l iDotFile$dog	iDotPath$l j\doiDotPath$iDotPath$j\doTdoiDotFile$iDotFile$iDotPath$dRTdRdRiOrgDot$iDotFile$dRiNgl iDotFile$j%dRdRiNl  doiLang$iGetLanguage$doiDotFile$giDotFile$iNl iLang$g	iDotFile$giDotFile$iNddogiDotFile$j doiDbgl  6j	Language (iLang$(jnot found, use (iDefaultLang$doiDotFile$giDotFile$iNl iDefaultLang$g	iDotFile$giDotFile$iNdoTddogiDotFile$j doiDbgl  6j	Customer (giDotFile$l (jnot found, use (iDefaultCust$doiPath$giDotFile$l doiName$giDotFile$l doiDotFile$iPath$jWSg	iName$giName$l doToddRgiDotFile$j ddoiDbgl  6j	Customer (giDotFile$l (jnot found, use (iDefaultCust$doiPath$giOrgDot$l doiName$giOrgDot$l doiDotFile$iPath$jWSg	iName$giName$l dRTRdRdRgiDotFile$j doi	ErrorExitjDocument template iDotFile$j
 not foundl  dRTodRdRi	BuildDot$iDotFile$ddddpC ------------------------------------------------------------------dp
 ErrorExitdpC ------------------------------------------------------------------ddi	ErrorExitiMessage$iErrNoddRiErrNol  dog+iMessage$jSAP R/3l0 dogGdR do-iErrNodRTdd diMAINdRdRiVar$gjDBG: Enter Var-Name:ititle$j dRiResult$i
R3VariablewGet$iVar$dR6jRequest for 'iVar$j' => 'iResult$j'dQd diMAINdRdRiVar$gjEnter variable name:ititle$j dRiValue$gjEnter new value:ititle$j dRi
R3VariablevDeposeiVar$iValue$dd dp: ---------------------------------------------------------dp Historydp 	dp6	    28/05/96   A-00216- Error with the protection fordp'				form fields. See function Terminatedp dp dp: ---------------------------------------------------------d/0niDbgodp: ---------------------------------------------------------dp Test subroutinedp0 	use the WordBasic Debugger the check this codedp: ---------------------------------------------------------diMAINdRg+j(Last modification on : 12/11/96. A-00306jBETAl@ ddk9---------------------------------------------------------dk Call R/3 Function Call  dk Arguments:	dk8	Fcode$: the function code, see interface description 		dk 	dk dk,		Flags$: flags, which data should be passeddk/				S: 	save document in RTF format to tmp-filedk"					before executing the RFC calldk				E:  exit worddk9			T:	Terminate DDE connection, but do not close documentdk3                ( This function has been modified )dk.			I:	Include PasteString after function call,dk'				PasteString must be a defined valuedk,				C:	Include a file at the insertion pointdk					after the function-call, dk&					if the value of IsChanged is "X".dk(					The value IsChanged must be defineddk				M:	Minimize Worddk dk dk  COMMENTS :dk dk6	15/02/96    This function is not called by the officedk				function anymore. dk9---------------------------------------------------------ddiExecuteiFcode$iFlags$dRiDbgl  R6g(j R3WinSvr::Execute((iFcode$(j,(iFlags$(j)ddR6jCall SAP R/3  Code:(iFcode$(j	 Options:(iFlags$ddRiDocFile$g%ddRiChanneli
GetChannelddRp( temp. for SapDocu: value changed = 'X' dRi	CmdFlags$iFlags$ddRgl iFlags$jSl  dodnk;  04/09/95 Bug A-0085. Some application terminate with the dRk0  Flag$ = "SE". In this case we save twice.    	dnkC  With the flag E with call Terminate where the file is 			'  saveddok dQogl iFlags$jEl  dodoi	ReadOnly$gMjReadOnlydoi	ReadOnly$j g#l  do)iCheckOledoQo)iSaveDocdoTdoTdRQodRTddRgl iFlags$jTl  doi
R3VariablevDeposej	DocOpenedjXdRTddRiFcode$j dQoiMarkedString$grgogpddoiCommand$iFcode$j(i	CmdFlags$j,iDocFile$j,dogl iMarkedString$gl" l  giMarkedString$l doiCommand$iCommand$gl" iMarkedString$gl" doTdoiCommand$iCommand$j)ddoiDbgl  R6jExecute:(iCommand$dog_iChanneliCommand$ddRTddRgl iFlags$jEl  doiDbgl  R6jClose Documentdoi	Terminatedo*iexitdRTddRgcjMicrosoft Wordl ddRgl iFlags$jIl  dog+j)Sorry, Option I not impl. in this versionjSAPl0 dRTddRgl iFlags$jCl  dog+j)Sorry, Option C not impl. in this versionjSAPl0 dRTddRgl iFlags$jPl  dog+j)Sorry, Option P not impl. in this versionjSAPl0 dRTdddk6   28/06/95 ****** WARNINGS **************************dk dk3   I assume that Office is the only one to use thisdk5   special part of the macro. Somebody will be happy dk dk6   ***************************************************ddRgl iFlags$jTl  dog]iChanneldogLjDDE-Channelj ddnk$ The activation is done by WsWinsrv.dnk dokIf AppIsRunning("SAP R/3") Thendok	AppActivate "SAP R/3", 1dokEndIf	ddo6jControl passed to SAP R/3dR do6jCallback to SAP R/3 completeddRTddRgl iFlags$jMl  dogAjMicrosoft Wordl dRTdeexitddddp7 ======================================================dp" Init connection to server programdp7    Appl$  : Application Name i.e. "R/3 Windows Server"dp2    Obj$	  : Functionmodule to connect (or "none")dp7 ------------------------------------------------------ddiInitiateiAppl$iObj$ddRiDbgl  R6jR3WinSvr::Connect ((iAppl$(j,(iObj$(j)dRdRgiAppl$l  doi	ErrorExitiAppl$j is not runningiErrdRTddRgjMicrosoft Wordj
DDETimeOutj1200jWINWORD6.INIddR6j Initialize connection to SAP R/3ddRiDbgl  R6j
Initiate: (iAppl$(j,(iObj$dRiChannelg\iAppl$iObj$dRiChan$giChannelddRgLjApplicationiAppl$dRgLjObjectiObj$dRgLjDDE-ChanneliChan$ddRggl l  gCjMicrosoft WorddRgcjMicrosoft Wordl ddddp7 ======================================================dp& Aktivate connection to server programdp4 	Document$ : Window name of the document to connectdp		Option$ :   not useddp7 ------------------------------------------------------ddi	Reconnecti	Document$iOptions$ddRiDbgl  R6jR3WinSvr::Reconnect ((i	Document$(j,(iOptions$(j)ddRgbi	Document$ddRiApplication$gMjApplicationdRiObject$gMjObjectdQdRgiApplication$l  doi	ErrorExitiApplication$j is not runningiErrdRTddR6j Initialize connection to SAP R/3ddRiDbgl  R6j
Initiate: (iApplication$(j,(iObject$dRiChannelg\iApplication$iObject$dRiChan$giChannelddRgLjDDE-ChanneliChan$ddRggl l  gCjMicrosoft WorddRgcjMicrosoft Wordl dddddk6======================================================dk dk NAME  : Terminatedk dk Release connectiondk dk1 A-00182 The  docmented could be release with notdk			logic		dk dk' A-00216  Error when in Form protectiondk dk A-00306  We clean the channel dk dk6======================================================di	TerminatedRi	DocStatusng#dRiChannelni
GetChannelddRiApplication$gMjApplicationddRgiApplication$l  doi	ErrorExitiApplication$j is not runningiErrdRTddRk:----------------------------------------------------------dRk( 03/09/95 & moved on th 19/04/96 A-00182dRk:----------------------------------------------------------dRk3 As for the modification of 10/08/95 the normal.dotdRk. is linked to the document which ask for untildRk< now only SAPSCRIPT as Office do not seem to car about this dRk
 any more.dRk: The flag NoLogic is set if the original document does notdRk' want to be linked to the SAP template.dRk:----------------------------------------------------------dRk	 05/06/96dRk2 A-00216 We do only if we are not in display modusdRk:----------------------------------------------------------dnniR3Docv	IsDisplayiFALSEdn	dRi
R3VariablewGet$jNoLogicjXdongW sR j
normal.dotdRddok dok(  Save file, in case of IMG this path isdok  never takendok doi	DocStatusl  do)iCheckOledo)iSaveDocdnRk At this level we can not call dnRk R3Doc.HasChanged as we shall dRQog_iChanneljchangedoTdok dok	A-00216. Reopenneddok dog$l  ddRTnk End of displayddR,-&dRg	dR,-*l  ddRgրl dRgl dRgրl  dRdR6jTerminate connection to SAP R/3ddRiSapDot$gdQRgiSapDot$l  dogiSapDot$l dogiSapDot$l  do dogwiSapDot$doTdRTddRgAjMicrosoft Wordl ddRg]iChanneldddpC ------------------------------------------------------------------dp Get DDE channel numberdp,		return:	Channel number of the DDE channel dpC ------------------------------------------------------------------ddi
GetChannelddRiApplication$gMjApplicationdRiObject$gMjObjectdRiChan$gMjDDE-ChanneldRi
ErrorText$jNo errorddRiApplication$j doi	ErrorExitjConnection not initializediErrdRTddRgiApplication$l  doi	ErrorExitiApplication$j Is Not running iErrdRTddRiChan$j doi	ErrorExitjNo connection for iApplication$iErrdR doi
GetChannelgiChan$dRTdddpC ------------------------------------------------------------------dp
 ErrorExitdpC ------------------------------------------------------------------ddniSaveDocddRiDocFile$g%dRiFmtl dRiType$g	iDocFile$l dRgiType$jRTFdoiFmtl dRgiType$jDOCdoiFmtl  dRgiType$jTXTdoiFmtl dR doi	ErrorExitjIllegal document type: iType$iErrdRTdnk dRk	 A-00306 dnk   We clear the channel dnk dQRiChan$gMjDDE-ChanneldngLjDDE-Channelj dRgT s iDocFile$s iFmtdRgLjDDE-ChanneliChan$dRg$l  ddddpC ------------------------------------------------------------------dp GetDocTypedpC ------------------------------------------------------------------ddiCheckOledRdR,-*i
NoOleLinksdRdR/idlg4g| deloop_oleddR>iDlgddRi	ErrorExitj)OLE-Links not allowed, please break linksl ddRiStatus?idlgdRiStatusl do>iDlgdoiLink$iDlgs dog| s ilink$sZdRTde
NoOleLinksdR,-*l  dddodpC ------------------------------------------------------------------dp
 ErrorExitdpC ------------------------------------------------------------------ddi	ErrorExitiMessage$iErrNoddRiErrNol  dog+iMessage$jSAP R/3l0 dogGl dRiErrNol  do-iErrNodR dog+iMessage$jSAP R/3l0 dRTddddp the end dRddp: ---------------------------------------------------------dp Test subroutinedp0 	use the WordBasic Debugger the check this codedp: ---------------------------------------------------------ddiMAINdRiCR$gl gl ddRiFct$gjEnter TD Command:ititle$jTDHIdRiNgiFct$gl dRiNl  iFct$giFct$iNl ddRiFlags$gj5Enter Flags:  (S:ave,I:nsert_String,C:opy_File,E:xit)ititle$j dRiNgiFlags$gl dRiNl  iFlags$giFlags$iNl ddRgGdRiR3WinSrvvExecuteiFct$iFlags$dRd ddiMainddRiSrc$gjSubstitude:jSAPj dRiRepl$gjReplacement:jSAPj ddRgHl dRgjMakros aus Dot-Vorlage ggiAnzahll dRgdRgHl  ddRidoc$g;dR#iAnzahll $gl doiName$giAnzahll dogHl dogiName$gl	 dogHl  dRdoggiName$dogddoiName$jUtildog s iName$ssPl  dogu siSrc$s iRepl$nss}l dp+  insert word commands to modify macro heredoid$g;dogl dnRTdogbidoc$dR&iAnzahldd diMAINdiil  d/im$l2 din$gjMacro name:jSAPj dg s iN$ssPl dgld l  ddp7 ExtrasMakro .Name = "TEST", .Bearbeiten, .Anzeigen = 1deloopdiiiil diil gl  l  dgl l dim$iigd6ii(j:(im$iidgim$iijEnd Subl  *iloopddgd diMAINdR6jMacro R3Variabledddp: ---------------------------------------------------------dp Get R/3 Valuedp dp dp Arguments:	dp 	Item$:  Field namedp: ---------------------------------------------------------dodiGet$iItem$dRiDbgl  njR3Variable::Get((iItem$(j)ddRiChanneli
GetChannelddRiDbgl  j	Request: (iItem$dRiResult$gaiChanneliItem$ddRgcjMicrosoft Wordl dRiDbgl  jO.K. ((iResult$(j)ddRiGet$iResult$dddp: ---------------------------------------------------------dp Set R/3 Valuedp-   depose a new value in a function parameterdp dp Arguments:	dp 	Item$:  Field namedp 	Value$: New valuedp: ---------------------------------------------------------dodiDeposeiItem$iValue$dRiDbgl  njR3Variable::Depose((iItem$(j,(iValue$(j)ddRiChanneli
GetChannelddRiDbgl  jPoke: (iItem$(j,(iValue$dRg`iChanneliItem$iValue$ddRgcjMicrosoft Wordl dRiDbgl  jO.K.dRdddpC ------------------------------------------------------------------dp Get DDE channel numberdpC ------------------------------------------------------------------ddi
GetChannelddRiApplication$gMjApplicationdRiObject$gMjObjectdRiChan$gMjDDE-ChanneldRi
ErrorText$jNo errorddRiApplication$j doi	ErrorExitjConnection not initializediErrdRTddRgiApplication$l  doi	ErrorExitiApplication$j Is Not running iErrdRTddRiChan$j doi	ErrorExitjNo connection for iApplication$iErrdR doi
GetChannelgiChan$dRTddddpC ------------------------------------------------------------------dp
 ErrorExitdpC ------------------------------------------------------------------ddi	ErrorExitiMessage$iErrNoddRiErrNol  dog+iMessage$jSAP R/3l0 dogGl dR do-iErrNodRTdd dp dp     NAME : R3Functions dp dp     DATE : 19/12/95  dp dp/     COMMENTS : Macro for special R3 Functions dp dp.		1) Scan the mergefields and send then to thedp		   WSWINSERVER dp dp dp  HISTORY : dp/     25/01/96  - Modification of SendMergeFielddp					to work in other Mailmergedp
					modusdp dp     10/10/96 -  A-00298dp:                       Error in SendMergefield an empty {}dp1	               could be selected has MERGEFIELD dp                       !!!! 	dp    28/10/96 - A-00301dpB                       We should cut the trailing /* in mergefielddp=                        this is authorized in WORD. There is dp=                       an other problem with nest mergefield dp9                       in case of conditional if etc.... dp dp	   05/06/98-  A-00524  dp0 					  Remove the formatting of the mergefield.diMAINdddkr------------------------------------------------------------------------------------------------------------------dk dk         GetMergeField$dk dk dks-------------------------------------------------------------------------------------------------------------------dni	GetMerge$ddni
SLanguage$iSapWordInfowGetLanguage$Rdn13i
sLanguage$do3jDdoi	GetMerge$jSERIENDRUCKFELDdo3jEdoi	GetMerge$j
MERGEFIELDdo3 doi	GetMerge$jUNSUPPORTEDdo1ddddk:----------------------------------------------------------dk  SendMergeFielddk3	We expecte than the DDE channel is open. The full dk2   document is scanned and all the information aredk2	send to the server. This Function has been build dk1	on R3CollectField form HR. ( Thank you BERND )  dk dk"'  WINWORD server used commands :dk	addmergefield( ) dk<'----------------------------------------------------------diSendMergeFieldddQd dk3---------------------------------------------------dk dk		Name       : SAPWordInfo  dk dk   dk		Author     : Alain Lesaffredk dk		Project    : SAP WINWORDdk dk		SubProject : dk dk		Version    : 2.00dk dk dk4----------------------------------------------------diMAINddddpB -----------------------------------------------------------------dp GetLanguage$dp1		return: the current winword-language (one char)dpB -----------------------------------------------------------------diGetLanguage$dRi	WordLang$gl dRgi	WordLang$l jDeutschdoiR3Lang$jDdRgi	WordLang$l jEnglishdoiR3Lang$jEdRgi	WordLang$l jFranaisdoiR3Lang$jFdRgi	WordLang$l
 j
NederlandsdoiR3Lang$jNdRgi	WordLang$l jItalianodoiR3Lang$jIdRgi	WordLang$l jNorskdoiR3Lang$jOdRgi	WordLang$l	 j	PortugusdoiR3Lang$jPdRgi	WordLang$l jEspaoldoiR3Lang$jSdRgi	WordLang$l jDanskdoiR3Lang$jKdR doiR3Lang$jDdoiDbgl  6jUnknown WinWord Language (g~(j, use (iR3Lang$dRTddRiGetLanguage$iR3Lang$dd diMAINddRg+jCreate Makro 'MakeMenu' ?jSAPl0 ddRg s jMakeMenust su jMakeMenuOlddRg s jMakeMenuss6j su j ddRgj(REM ADD MENUES DIFFERING FROM NORMAL.DOTdRgddRgj.ExtrasAnpassenMen .VorgabeAlles, .Kontext = 1dRgdRiqt$gl" ddR#iil $g?l  l doim$g@l  iil doifl  do#ikl $g?l  l  dog@l  ikl  im$ifl do&ikdoifl dogjREM  STANDARD giigl	 j:im$dogdo doic$jExtrasAnpassenMenleistedoic$ic$j .Position = giij,doic$ic$j .MenText = iqt$im$iqt$j,doic$ic$j .Hinzufgen, doic$ic$j .Kontext = 1dogic$dogdoTdo#ijl $gAim$l  l doie$g=im$l  ijl doix$g>im$l  ijl doigl  doifl do#ikl $gAim$l  l  do6ii(j: (im$(j (ij(j: (ie$(j (g=im$l  ikl  dog=im$l  ikl  ie$igl do&ikdoTdoigl doggl	 jREM  STANDARD gijj ie$j:ix$dogdo doikatl do#ikl $gl do6ii(j: (im$(j (ij(j: (ie$(j (gikl doggikl gix$ikatl do&ikodoix$j(Trennlinie)ikatl doic$jExtrasAnpassenMen doic$ic$j .Position = gijj,doic$ic$j .Kategorie = gikatj,doic$ic$j	 .Name = iqt$ix$iqt$j,doic$ic$j	 .Men = iqt$im$iqt$j,doic$ic$j .MenText = iqt$ie$iqt$j,doic$ic$j .Hinzufgenj,doic$ic$j .Kontext = 1doggl	 ic$dogdoTdo&ijdR&iiddRgj(REM REMOVE UNUSED MENUES FROM NORMAL.DOTdRgddR#iil $g?l  l  doim$g@l  iil  doifl  do#ikl $g?l  l dog@l  ikl im$ifikdo&ikddoifl  dogjREM  USE STANDARD giigl	 j:im$dogddo#ijl $gAim$l  l  doie$g=im$l  ijl  doix$g>im$l  ijl  dodoigl  do#ikl $gAim$l  l do6ii(j: (im$(j (ij(j: (ie$(j (g=im$l  ikl dog=im$l  ikl ie$igl do&ikdoigl doggl	 jREM  STANDARD gijj ie$j:ix$dogdo dodoic$jExtrasAnpassenMen doic$ic$j .Position = -1,dop- c$ = c$ + " .Kategorie = " + Str$(kat) + ","doic$ic$j	 .Name = iqt$ix$iqt$j,doic$ic$j	 .Men = iqt$im$iqt$j,doic$ic$j .MenText = iqt$ie$iqt$j,doic$ic$j .Entfernenj,doic$ic$j .Kontext = 1doggl	 ic$dogdoTdo&ijdo doic$jExtrasAnpassenMenleistedoic$ic$j	 .Men = iqt$im$iqt$j,doic$ic$j .Entfernen, doic$ic$j .Kontext = 1dogic$dogdoTdR&iiddRgj
REM  READYdRgddR6jReadydd diMAINdRi	ReadOnly$gMjReadOnlydRi	ReadOnly$j do-l!dR dog dRTd diMAINdRi	ReadOnly$gMjReadOnlydRi	ReadOnly$j do-l!dR dog	dRTd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        u                    p   p   p   p   p   p         p                                                                                                                                                                                                                                                                                                                                                                                                                                        K        @  Normal     a . @  . 	Heading 1  
   <  U] c k  , @  , 	Heading 2  
   < 
 UV] c               " A@ " Default Paragraph Font             N -@N 
Macro Text +    1 % 	`	@            	 ] ac                     !                               lesaffre alainD:\locngu30.tmp\wsword.dotlesaffre alainD:\locngu30.tmp\wsword.dotlesaffre alainD:\locngu30.tmp\wsword.dotlesaffre alainD:\locngu30.tmp\wsword.dotlesaffre alainD:\locngu30.tmp\wsword.dotlesaffre alainD:\locngu30.tmp\wsword.dotLesaffre AlainC:\wsword.dotGerd Balzuweit+C:\projekte\WordLinkR3\CurrDot95\wsword.dotiXOS AS GmbH Leipzig)F:\Program Files\sapgui\SAPGUI\wsword.dotGerd Balzuweit)C:\Program Files\SAPpc\SAPGUI\wsword1.dot- Application DDE-Channell Object   SAP R/3 WinWord Server  3 Edit_Text_Exit_Td U             U    %       %  U   @,        @,  U              ,  U    M        M  U    CN        HN  U     N  !     N  U    p  "     p  U 	  	 r       r  U 
 
 t        t  U   u       u  U   |       |  U     J       U    އ  9
       U      O        U    f  O      k  R3WinSrv R3GetVar R3Dbg R3SetVar R3GenMakeMenu 	R3Execute FGenerate Macro 'MakeMenu', which builds the actual menu configuration  	R3Replace +Interactive macro:
 Send command to server Replace a string in all macros 
R3GenMakro Communiction routines for R/3 Windows-Server
Connect (ServerName$,FunctionModuleName$)
Execute (Function$,Flags$)
Disconnect
SetVar(VarName$, NewValue$) 
GetVar(VarName$)
Reconnect (Window$) Set trace value IInteractive macro:
Set a variable (import-parameter) in the R/3 RFC call KInteractive macro:
Get a variable (export-parameter) from the R/3 RFC call 
R3Variable R3Tools R3Table EinfgenAnmerkung DFgt ein Anmerkungszeichen ein und ffnet den Anmerkungs-Ausschnitt. ExtrasDokumentschutzAufheben 4Hebt den Dokumentschutz fr das aktive Dokument auf. R3Doc xUser access to the global document information. The functions and subroutines gives direct access to R3 document states. R3Functions !Entry point for SAP WORD server.  SAPWordInfo &Sichern In Rohfassung                                                                                                                                              &Versionshistorie    &Terminologie Suchen                    &Release Information Schlagworte             &Information zum Dokument                                  &Bearbeitenx &Bearbeiten E&xtras 
&SpringenX 	Z&ustzeX &EinbindenX          &Verwendungsnachweis                      %&Glossarindezierung einzelne Begriffe          Attribute anzeigen   R3DBG  R3DOC  R3TABLE  R3TOOLS  R3GETVAR  R3SETVAR  R3WINSRV  	R3EXECUTE 	 	R3REPLACE 
 
R3GENMAKRO  
R3VARIABLE  R3FUNCTIONS  SAPWORDINFO  R3GENMAKEMENU  EINFGENANMERKUNG  EXTRASDOKUMENTSCHUTZAUFHEBEN @PS to File Ne00: winspool Apple LaserWriter II NT v47.0 PS to File                       P| p     
od   ,        etter   
od   ,       L                     PRIV                                                                                        '''  '        PS to File                       P| p     
od   ,        etter   
od   ,       L                     PRIV                                                                                        '''  '                                 C   Times New Roman  Symbol &  Arial 5  Courier New "          E0E                                          !    ,       GUIiXOS AS GmbH Leipzig                                                                                                                                                                                                                                                                   ܥh W	   e              +  ±                  +                                      l      l   l      l      l      l      l                   M   Ͱ  8                         '  C   %      %      %      %      %      %      %      %      %     '      '      '      '      '      '      j  X   ±      '                      l      %        V W   %      %                      %      %      '      %      l      l      %                      %      %      %      %      %      l      %      l      %      %              0FXƿ            l      l      l      l      %      %      %      %                                                                                            istjetztmitnichtundvorwie .A                                                                                                                                                                                                   +  B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 u           
          "  &  *  +                                                                                                                                                                                                                                                                                                                                                                                                                                                               K        @  Normal     ]c                  " A@ " Default Paragraph Font               +    +   M (c)(r)1/21/43/4itsjeztmtincihtudnvrowei                
               "   &   *   +         B  J V       +  K W @C   Times New Roman  Symbol &  Arial 5  Courier New "                                                                                                                                                                 	   
                                                                      !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?   @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   ]   e   R o o t   E n t r y                      
    ~P        	           F    `[0FXƿ\       TW o r d D o c u m e n t        @             @]                                     8           ±    C o m p O b j              8                                                                j        S u m m a r y I n f o r m a t i o n                           (                                                                     	             
   	           F   Microsoft Word Document 
   MSWordDoc    Word.Document.6 9q            ࡱ                3                    Oh +'0                                                        	          
   D     P     \     h     t     |                         an        m       GUI         m        WRM      wsword.dot        iXOS AS GmbH Leipzig ]       11 M      Microsoft Word for Windows 95 do@    G     D o c u m e n t S u m m a r y I n f o r m a t i o n           8                                      
                                                                                                                                                                                                                                                                                                                                                                        3                    ՜. +,0            H      P      `      h      p      x                          SAP AG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @   * Ww@    NxMƿ@    Э8Xƿ                          ࡱ                >  	               Z            3                    ՜. +,0            H      P      `      h      p      x                          SAP AG                                                        ࡱ                >  	            