Visual Basic to Word6 translation 
Author Message
 Visual Basic to Word6 translation

The following code is from CPPSUM.DLL.
It is written in Visual Basic for Applications.
I want to use the code in a Word6 Macro.
I really want to use the SumInfoGetTIME function.
I know there is a cppsumw.txt with an example, but it is
not for this function.
Would anyone be so kind as to translate this code for me?

'---------------------------------------------------------------------------

   ' String properties
Global Const PID_TITLE          = &H02
Global Const PID_SUBJECT        = &H03
Global Const PID_AUTHOR         = &H04
Global Const PID_KEYWORDS       = &H05
Global Const PID_COMMENTS       = &H06
Global Const PID_TEMPLATE       = &H07
Global Const PID_LASTAUTHOR     = &H08
Global Const PID_REVNUMBER      = &H09
Global Const PID_APPNAME        = &H12

   ' Time properties
Global Const PID_TOTAL_EDITTIME = &H0A
Global Const PID_LASTPRINTED    = &H0B
Global Const PID_CREATED        = &H0C
Global Const PID_LASTSAVED      = &H0D

   ' Long integer properties
Global Const PID_PAGECOUNT      = &H0E
Global Const PID_WORDCOUNT      = &H0F
Global Const PID_CHARCOUNT      = &H10
Global Const PID_SECURITY       = &H13

   ' bit masks for security long integer
Global Const AllSecurityFlagsEqNone         = &H00
Global Const fSecurityPassworded            = &H01
Global Const fSecurityRORecommended         = &H02
Global Const fSecurityRO                    = &H04
Global Const fSecurityLockedForAnnotations  = &H08

Declare Function SumInfoInit Lib "CPPSUM.DLL" () As Integer
Declare Function SumInfoOpenFile Lib "CPPSUM.DLL" (ByVal szPath As String)
As Integer
Declare Function SumInfoGetString Lib "CPPSUM.DLL" (ByVal hSumInfo As
Integer, ByVal pid As Long, ByVal lpBuf As String, ByVal cbBuf As Integer)
As Integer
Declare Function SumInfoGetLong Lib "CPPSUM.DLL" (ByVal hSumInfo As
Integer, ByVal pid As Long, lpLong As Long) As Integer
Declare Function SumInfoGetTime Lib "CPPSUM.DLL" (ByVal hSumInfo As
Integer, ByVal pid As Long, lpYr%, lpMon%, lpDay%, lpHr%, lpMin%, lpSec%)
As Integer
Declare Sub SumInfoCloseFile Lib "CPPSUM.DLL" (ByVal hSumInfo As Integer)
Declare Sub SumInfoUninit Lib "CPPSUM.DLL" (ByVal wInitStatus as Integer)

'---------------------------------------------------------------------------

' Visual Basic interface definitions for CPPSUM.DLL
' DLL functions to get summary info from OLE 2.0 document files.
'
'     Copyright ? 1994-1995 Somar Software, All Rights Reserved

'     Visit the Somar Software WWW site at http://www.*-*-*.com/
'
' Example of usage:
'    Dim wInitStatus as Integer, hSumInfo As Integer, bResult As Integer
'    Dim s$, yr%, mon%, dy%, hr%, min%, sec%
'    wInitStatus = SumInfoInit()
'    If wInitStatus <> 0 Then
'       hSumInfo = SumInfoOpenFile("..put your file name here..")
'       If hSumInfo <> 0 Then
'          s$ = String$(256, " ")
'          bResult = SumInfoGetString(hSumInfo, PID_TITLE, s$, 256)
'          bResult = SumInfoGetTime(hSumInfo, PID_LASTSAVED, yr%, mon%,
dy%, hr%, min%, sec%)
'          SumInfoCloseFile (hSumInfo)
'       End If
'       SumInfoUninit(wInitStatus)
'    End If
'
' Reasons for failure:
'     SumInfoInit:     out of memory
'     SumInfoOpenFile: out of memory
'                      file not found
'                      file is not an OLE 2.0 structured storage file
'                      file does not contain OLE 2.0 summary info
'                      OLE 2.0 summary info is incorrectly formatted
'     SumInfoGet...  : specified property type is not available
'    
' See CPPSUM.CPP for change log
'---------------------------------------------------------------------------

Mark van Sommeren



Sun, 13 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. visual basic and clipper - need a translation

2. Translation of a SOAP Envelope - Visual Basic/SOAP Toolkit to Java/Apache

3. Translation from PHP to Visual Basic

4. Translation from PHP to Visual Basic

5. ToolBook to Visual Basic translation

6. MS Word6 Basic question

7. do Visual Basic 6.0 and Visual Basic .NET version beta Working Both

8. basic to c translation

9. Old basic translation

10. C++ to Basic translation of Linear/Binary Search

11. Difference between Visual Basic 6 and Visual Basic.Net

12. Visual basic 4 to Visual basic 6

 

 
Powered by phpBB® Forum Software