ÿÿ  CHHVBScriptEngine       ÿþÿ	( G e n e r a l )    ÿþÿ( D e c l a r a t i o n s ) ÿþÿ' ( D e c l a r a t i o n s )  
 ÿþÿÿ?' R e m a r k :   D i g i t a l   D a t a   -   D o c u m e n t   E x p o r t   M a c r o  
 '  
 ' V B   S c r i p t   D o c u m e n t  
 '  
 ' E x p o r t   S c r i p t   f o r   W i n L i n e   d o c u m e n t s .  
 ' C o n f i g u r a t i o n   h a s   t o   b e   d o n e   i n   S Q L   T a b l e s   T B D D _ D O C E X P O R T _ C O N F I G U R A T I O N   a n d   T B D D _ D O C E X P O R T _ P R O F I L E  
 '  
 ' D i g i t a l   D a t a  
 ' L u d w i g - R i n n - S t r a ß e   1 6  
 ' 3 5 4 5 2   H e u c h e l h e i m  
 ' T e l . :   0 6 4 1   /   2 0 2 3 6 0  
 ' E - M a i l :   i n f o - f l o w ( a t ) d i g i t a l d a t a . w o r k s  
 '  
 ' V e r s i o n   N u m b e r :   2 . 0 . 0 . 0  
 ' V e r s i o n   D a t e :   0 1 . 0 2 . 2 0 2 0  
  
 O n   E r r o r   R e s u m e   N e x t  
  
 ' # # # # # # # # # #   s e t   v a r i a b l e s   # # # # # # # # # #  
 C w l s t a r t . M a c r o C o m m a n d s . M R u n M a c r o S u s p e n d e d   " T E S T "  
 S e t   w s h s h e l l   =   C r e a t e O b j e c t ( " W S c r i p t . S h e l l " )  
 S e t   F i l e S y s t e m O b j e c t   =   C r e a t e O b j e c t ( " S c r i p t i n g . F i l e S y s t e m O b j e c t " )  
  
 p a r a m s   =   M P a r a m e t e r s   '   u n b e d i n g t   n o t w e n d i g   u m   a u f   d i e   P a r a m e t e r   a l s   F e l d   z u g r e i f e n   z u   k ö n n e n  
 D e b u g M o d e   =   p a r a m s ( 2 0 )  
 S Q L T a b l e     =   p a r a m s ( 2 1 )  
 S Q L Q u e r y     =   p a r a m s ( 2 2 )  
 M a c r o M o d e   =   p a r a m s ( 2 3 )  
 D O C E X P O R T _ w a i t   =   p a r a m s ( 2 4 )  
 D O C E X P O R T _ T r y s   =   1 0   ' p a r a m s ( 2 5 )  
 D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E   =   F i l e S y s t e m O b j e c t . G e t A b s o l u t e P a t h N a m e ( p a r a m s ( 2 6 ) )  
  
 S e r v e r P a t h   =   c w l s t a r t . S e r v e r P a t h  
 C u r r e n t U s e r   =   c w l s t a r t . C u r r e n t U s e r  
  
  
  
 ' # # # # # # # # # #   p r e p a r i n g   p a r t   # # # # # # # # # #  
  
 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	  
 	 C R L F   =   c h r ( 1 3 ) & c h r ( 1 0 )    
 	 m s g   =   " P a r a m e t e r : "   &   C R L F    
 	    
 	 F o r   i   =   1   T o   U b o u n d ( p a r a m s )    
 	 	 m s g   =   m s g   &   i   &   " . :   "   &   p a r a m s ( i )   &   C R L F    
 	 N e x t    
  
 	 m s g b o x   m s g   , ,   " M a c r o   N a m e :   "   &   C W L M a c r o . M N a m e  
 E n d   I f  
  
 D o  
  
 	 L o o p C o u n t e r   =   L o o p C o u n t e r   +   1  
 	  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 M S G B O X ( " T h e   v a l u e   o f   i   i s   :   "   &   L o o p C o u n t e r )  
 	 E n d   I f  
 	  
 L o o p   U n t i l   ( L o o p C o u n t e r   =   D O C E X P O R T _ T r y s )   O r   ( F i l e S y s t e m O b j e c t . F i l e E x i s t s ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E ) )  
  
 S e t   D O C E X P O R T _ F I L E N A M E 	 =   F i l e S y s t e m O b j e c t . G e t F i l e ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E )  
 D O C E X P O R T _ P A T H 	 	 =   F i l e S y s t e m O b j e c t . G e t P a r e n t F o l d e r N a m e ( D O C E X P O R T _ F I L E N A M E )  
  
  
  
  
 ' # # # # # # # # # #   m a i n   p a r t   # # # # # # # # # #  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 I f   M a c r o M o d e   =   " R U N _ P R O G R A M "   T h e n  
  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 M S G B O X   " P r o g r a m m - A u s f ü h r u n g   n a c h   d e m   D o k u m e n t e n   E x p o r t   a k t i v i e r t . " , , " M a c r o M o d e :   "   &   M a c r o M o d e  
 	 E n d   I f  
  
 	 R U N _ P r o g r a m   =   p a r a m s ( 2 7 )  
 	 R U N _ P R O G R A M _ P A R A M E T E R 1   =   p a r a m s ( 2 8 )  
 	 R U N _ P R O G R A M _ P A R A M E T E R 2   =   p a r a m s ( 2 9 )  
 	 R U N _ P R O G R A M _ P A R A M E T E R 3   =   p a r a m s ( 3 0 )  
  
 	 I f   F i l e S y s t e m O b j e c t . F i l e E x i s t s ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E )   T h e n  
  
 	 	 w s h s h e l l . r u n   R U N _ P r o g r a m   &   R U N _ P R O G R A M _ P A R A M E T E R 1   &   R U N _ P R O G R A M _ P A R A M E T E R 2   &   R U N _ P R O G R A M _ P A R A M E T E R 3  
 	 	  
 	 E l s e  
 	  
 	 	 M S G B O X 	 " F e h l e r   b e i m   A u s f ü h r e n   d e s   P r o g r a m m s :   "   &   v b C r l f   &   _  
 	 	 R U N _ P r o g r a m , , " B i t t e   i n f o r m i e r e n   S i e   I h r e n   A d m i n i s t r a t o r ! "  
  
 	 E n d   I f 	  
 	  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 E l s e i f   M a c r o M o d e   =   " O P E N _ F I L E _ A F T E R _ E X P O R T "   T h e n  
  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 M S G B O X   " Ö f f n e n   d e r   e x p o r t i e r t e n   D a t e i   a k t i v i e r t . " , , " M a c r o M o d e :   "   &   M a c r o M o d e  
 	 E n d   I f  
  
 	 I f   F i l e S y s t e m O b j e c t . F i l e E x i s t s ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E )   T h e n  
 	  
 	 	 w s h s h e l l . r u n   D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E  
 	 	  
 	 E l s e  
 	  
 	 	 M S G B O X 	 " F e h l e r   b e i m   ö f f n e n   d e r   D a t e i :   "   &   v b C r l f   &   _  
 	 	 D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E , , " B i t t e   i n f o r m i e r e n   S i e   I h r e n   A d m i n i s t r a t o r ! " 	  
 	  
 	 E n d   I f  
 	  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 E l s e i f   M a c r o M o d e   =   " V E R I F Y _ E X P O R T _ A N D _ L O G 2 D B "   T h e n  
  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 M S G B O X   " Ü b e r p r ü f e   E x p o r t   i n k l .   D a t e n b a n k - P r o t o k o l l i e r u n g   a k t i v i e r t . " , , " M a c r o M o d e :   "   &   M a c r o M o d e  
 	 E n d   I f  
 	  
 	  
 	 	 ' 	 S e t   t m p   =   C W L S t a r t . C u r r e n t C o m p a n y . C o n n e c t i o n . S e l e c t   ( " S e l e c t   t o p   1   c 0 0 0   f r o m   [ C W L S Y S T E M ] . [ d b o ] . [ t 0 6 9 C M P ]   ( N O L O C K )   w h e r e   c 0 0 1   =   ' "   &   e i g . v a l u e ( " c 0 0 2 " )   &   " ' " )  
 	 	 ' m s g b o x   t m p   & " , " & e i g . v a l u e ( " c 0 0 2 " )  
 	 	 ' I f   t m p   > =   0   t h e n  
 	  
 	  
 	 	 	 ' 	 I f   e i g e n s c h a f t e n   ( i )   < >   " "   T h e n  
 	 	 	 ' 	 	 s q l   =   " i n s e r t   i n t o   t 0 7 0   ( c 0 0 0 , c 0 0 1 , c 0 0 2 , c 0 0 3 , m e s o c o m p , m e s o y e a r )   V a l u e s   ( ' " & a s p . v a l u e ( " c 0 0 0 " ) & " ' , " & e i g e n s c h a f t e n ( i ) & " , ' " & C W L S t a r t . C u r r e n t C o m p a n y . N r & " ' , " & j a h r & " ) "  
 	 	 	 	 	 ' m s g b o x   s q l  
 	 	 	 ' 	 	 C W L S t a r t . C u r r e n t C o m p a n y . C o n n e c t i o n . E x e c u t e S Q L   ( s q l )  
 	 	 	 ' 	 E l s e  
 	 	 	 ' 	 	 E x i t   F o r  
 	 	 	 ' 	 E n d   I f 	  
 	  
 	  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 E l s e i f   M a c r o M o d e   =   " V E R I F Y _ E X P O R T _ A N D _ L O G 2 F I L E "   T h e n  
  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 M S G B O X   " Ü b e r p r ü f e   E x p o r t   i n k l .   D a t e i - P r o t o k o l l i e r u n g   a k t i v i e r t . " , , " M a c r o M o d e :   "   &   M a c r o M o d e  
 	 E n d   I f  
  
 	 L o g P a t h   =   S e r v e r P a t h   &   " \ U s e r \ "   &   C u r r e n t U s e r   &   " \ "  
 	 L o g F i l e   =   L o g P a t h   &   " \ "   &   " D O C E X P O R T _ "   &   ( Y e a r ( d a t e ) )   &   " - "   & ( m o n t h ( d a t e ) )   &   " - "   &   ( d a y ( d a t e ) )   &   " . l o g "  
  
 	 S e t   L o g F i l e   =   F i l e S y s t e m O b j e c t . O p e n T e x t F i l e ( L o g P a t h & L o g F i l e ,   8 ,   T r u e )  
  
       ' C h e c k   i f   d e s t i n a t i o n   f o l d e r   /   f o l d e r   s t r u k t u r e   e x i s t s .   I f   n o t ,   t r y   t o   c r e a t e .  
       I F   N O T   F i l e S y s t e m O b j e c t . F o l d e r E x i s t s ( L o g P a t h )   T H E N  
  
 	       s t r D i r   =   F i l e S y s t e m O b j e c t . G e t A b s o l u t e P a t h N a m e ( L o g P a t h )  
 	       a r r D i r s   =   S p l i t (   s t r D i r ,   " \ "   )  
  
 	       I f   L e f t (   s t r D i r ,   2   )   =   " \ \ "   T H E N  
 	       	       s t r D i r B u i l d   =   " \ \ "   &   a r r D i r s ( 2 )   &   " \ "   &   a r r D i r s ( 3 )   &   " \ "  
 	 	       i d x F i r s t         =   4  
 	       E l s e  
 	 	       s t r D i r B u i l d   =   a r r D i r s ( 0 )   &   " \ "  
 	 	       i d x F i r s t         =   1  
 	       E n d   I f  
  
 	       F o r   i d x   =   i d x F i r s t   t o   U b o u n d (   a r r D i r s   )  
 	 	       s t r D i r B u i l d   =   F i l e S y s t e m O b j e c t . B u i l d P a t h (   s t r D i r B u i l d ,   a r r D i r s ( i d x )   )  
 	 	       I f   N o t   F i l e S y s t e m O b j e c t . F o l d e r E x i s t s (   s t r D i r B u i l d   )   T H E N  
 	 	 	       F i l e S y s t e m O b j e c t . C r e a t e F o l d e r   s t r D i r B u i l d  
 	 	       E n d   i f  
 	       N e x t  
  
       E n d   I f  
        
       I f   ( F i l e S y s t e m O b j e c t . F o l d e r E x i s t s ( L o g P a t h ) )   T h e n  
        
       	 	 I f   ( F i l e S y s t e m O b j e c t . F i l e E x i s t s ( L o g F i l e ) )   T h e n  
        
 	       	 	 I f   ( F i l e S y s t e m O b j e c t . F i l e E x i s t s ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E ) )   T h e n  
 	        
 	 	 	 	 L o g F i l e . W r i t e L i n e   ( C s t r ( N o w ( ) )   &   " , "   &   R i g h t ( C s t r ( T i m e r ( )   *   1 0 0 ) , 2 ) )   &   " :   ( E R F O L G R E I C H )   D i e   D a t e i   "   &   D O C E X P O R T _ F I L E N A M E   &   "   w u r d e   e r f o l g r e i c h   v o n   "   &   C u r r e n t U s e r   &   "   n a c h   "   &   D O C E X P O R T _ P A T H   &   "   e x p o r t i e r t ! "  
 	        
 	       	 	 E l s e  
 	  
 	 	 	 	 L o g F i l e . W r i t e L i n e   ( C s t r ( N o w ( ) )   &   " , "   &   R i g h t ( C s t r ( T i m e r ( )   *   1 0 0 ) , 2 ) )   &   " :   ( F E H L E R )   D i e   D a t e i   "   &   D O C E X P O R T _ F I L E N A M E   &   "   w u r d e   N I C H T   e r f o l g r e i c h   v o n   "   &   C u r r e n t U s e r   &   "   n a c h   "   &   D O C E X P O R T _ P A T H   &   "   e x p o r t i e r t ! "  
 	  
 	       	 	 E n d   I f  
  
 	       E l s e  
 	        
 	 	 	 M S G B O X 	 " F e h l e r   b e i m   e r z e u g e n   d e r   P r o t o k o l l d a t e i   ( L o g F i l e ) :   "   &   v b C r l f   &   _  
 	 	 	 L o g P a t h , , " B i t t e   i n f o r m i e r e n   S i e   I h r e n   A d m i n i s t r a t o r ! " 	  
 	        
 	       E n d   I f  
  
       E l s e  
        
 	 	 M S G B O X 	 " F e h l e r   b e i m   e r z e u g e n   d e s   P r o t o k o l l p f a d s   ( L o g P a t h ) :   "   &   v b C r l f   &   _  
 	 	 L o g P a t h , , " B i t t e   i n f o r m i e r e n   S i e   I h r e n   A d m i n i s t r a t o r ! " 	  
        
       E n d   I f  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 E l s e i f   M a c r o M o d e   =   " V E R I F Y _ E X P O R T _ A N D _ M S G B O X "   T h e n  
  
 	 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 	 m s g b o x   " Ü b e r p r ü f e   E x p o r t   i n k l .   B e n a c h r i c h t i g u n g   a k t i v i e r t . " , , " M a c r o M o d e :   "   &   M a c r o M o d e  
 	 E n d   I f  
  
 	 F o r   L o o p C o u n t e r   = 1   T o   1 0  
  
 	 I f   F i l e S y s t e m O b j e c t . F i l e E x i s t s ( D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E )   T h e n  
 	  
 	 	 M S G B O X 	 " B e s t ä t i g t e r   E x p o r t ,   v o n   D a t e i :   "   &   v b C r l f   &   _  
 	 	 	 	 D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E , , " E x p o r t   e r f o l g r e i c h   a u s g e f ü h r t ! "  
 	  
 	 E l s e  
 	  
 	 	 M S G B O X 	 " F e h l e r   b e i   E x p o r t ,   v o n   D a t e i :   "   &   v b C r l f   &   _  
 	 	 	 	 D O C E X P O R T _ P A T H _ A N D _ F I L E N A M E , , " B i t t e   i n f o r m i e r e n   S i e   I h r e n   A d m i n i s t r a t o r ! " 	  
 	  
 	 E n d   I f  
 	 N e x t  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 E l s e  
  
 	 M S G B O X   " B i t t e   p r ü f e n   S i e   d i e   v e r w e n d e t e n   P a r a m e t e r . " , , " U n g ü l t i g e r   A u f r u f ! "  
  
 E n d   I f  
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 ' # # # # # # # # # #   f i n a l   p a r t   # # # # # # # # # #  
 I f   D e b u g M o d e   =   " E n a b l e d "   T h e n  
 	 S u b   R u n M a c r o  
 	 ' 	 R e t u r n   t o   M a c r o   W i n d o w  
 	 	 M A p p l i c a t i o n   2  
 	 	 M A p p l i c a t i o n   0  
 	 	 M W i n d o w   4 5 ,   F a l s e  
 	 	 M S e t F i e l d F o c u s   4 5 ,   1 0 0  
 	 	 M S e t F i e l d F o c u s   4 5 ,   - 1  
 	 	 M S e t F i e l d F o c u s   4 5 ,   - 1  
 	 	 M A c t i v a t e W i n d o w   4 5  
 	 E n d   S u b  
 E n d   I f 	  
 ÿþÿ' E n d   o f   ( D e c l a r a t i o n s )  
  
 d F o c u s   4 5 ,   - 1  
 	 	 M A c t i v a t e W i n d o w   4 5  
 	 E n d   S u b  
 E n d   I f 	  
 ÿþÿ' E n d   o f   ( D e c l a r a t i o n s )  
  
 