Products  |  Solutions  |  Support  |  Download  |  Order  
   
 Home  |  Forum  |  Knowledge Base  |  Search 


WordPerfect Integration

Biblioscape and WordPerfect integration is achieved through Window's Dynamic Data Exchange (DDE). Biblioscape and WordPerfect can both act as DDE server and client. The following functions are included in the WordPerfect template file bib_WP.wpt.

papFormat: saves the current document in RTF and send the file path to Biblioscape to format.
papUnformat: saves the current document in RTF and send the file path to Biblioscape to unformat.
htmlPapFormat: saves the current document in HTML and send the file path to Biblioscape to format.
htmlPapUnformat: saves document in HTML and send the file path to Biblioscape to unformat.
addTag: prompt user to enter search string and sent to Biblioscape to run full text search.
convertGreek: convert Greek letter word into symbol. For example, "alpha" to "
a".

//papFormat
Application (WordPerfect; "WordPerfect"; Default; "US")
//turn off the hidden text first
PrefDisplaySet (ShowHiddenText: No!)
PrefSave ()
//MESSAGEBOX(x; "test"; myRTFFile; IconInformation!)
//First save the existing file as doc format
//this is absolutely neccessayr for WP, otherwise the myRTFFile send
//to Biblioscape is wrong and cause memory problem
FileSave (ExportType: RTF!)
// Get file path and file name, so I know where to save the RTF file
myRTFFile = ?Path + strLeft(?Name; strPos(?Name; ".")) + "RTF"
//Then save the existing file as RTF format
FileSave (myRTFFile; ExportType: RTF!)
//Close the existing file
Close ()
//Check if Biblioscape is running, and open a DDE channel
//send the save RTF file fullName to let Biblioscape to process
hConv := DDEINITIATE("Biblioscape"; "DdeServerConv_scan")
IF(hConv) // IF hConv not equal to 0
    //open a chanel send the path, but do not respond in biblioscape, because
    //before closing the chanel, DDECommand send to word get no response
    DDEPOKE(hConv; "DdeServerItem_scan"; "WPWin; rtfToRtf; " + myRTFFile)
    //biblioscape will respond to this closeing event, and initiate another
    //DDE link and send in command
    DDETERMINATE(hConv)
ELSE
    MESSAGEBOX(x; "ERROR"; "Biblioscape is not running, please start Biblioscape first."; IconQuestion!)
ENDIF

//papUnformat
Application (WordPerfect; "WordPerfect"; Default; "US")
//MESSAGEBOX(x; "test"; myRTFFile; IconInformation!)
//First save the existing file as doc format
FileSave (ExportType: RTF!) 
// Get file path and file name, so I know where to save the RTF file
myRTFFile = ?Path + strLeft(?Name; strPos(?Name; ".")) + "RTF"
//Then save the existing file as RTF format
FileSave (myRTFFile; ExportType: RTF!)
//Close the existing file
Close ()
//Check if Biblioscape is running, and open a DDE channel
//send the save RTF file fullName to let Biblioscape to process
hConv := DDEINITIATE("Biblioscape"; "DdeServerConv_scan")
IF(hConv) // IF hConv not equal to 0
    //open a chanel send the path, but do not respond in biblioscape, because
    //before closing the chanel, DDECommand send to word get no response
    DDEPOKE(hConv; "DdeServerItem_scan"; "WPWin; unformatRtfToRtf; " + myRTFFile)
    //biblioscape will respond to this closeing event, and initiate another
    //DDE link and send in command
    DDETERMINATE(hConv)
ELSE
    MESSAGEBOX(x; "ERROR"; "Biblioscape is not running, please start Biblioscape first."; IconQuestion!)
ENDIF

//HtmlPapFormat
Application (WordPerfect; "WordPerfect"; Default; "US")
//MESSAGEBOX(x; "test"; myRTFFile; IconInformation!)
//First save the existing file as doc format
//this is absolutely neccessayr for WP, otherwise the myRTFFile send
//to Biblioscape is wrong and cause memory problem

FileSave ()
// Get file path and file name, so I know where to save the RTF file
myHTMFile = ?Path + strLeft(?Name; strPos(?Name; ".")) + "HTM"
//Then save the existing file as RTF format
FileSave (myHTMFile; ExportType: HTML!)
//Close the existing file
Close ()
//Check if Biblioscape is running, and open a DDE channel
//send the save RTF file fullName to let Biblioscape to process

hConv := DDEINITIATE("Biblioscape"; "DdeServerConv_scan")
IF(hConv) // IF hConv not equal to 0
    //open a chanel send the path, but do not respond in biblioscape, because
    //before closing the chanel, DDECommand send to word get no response

    DDEPOKE(hConv; "DdeServerItem_scan"; "WPWin; htmlToHtml; " + myHTMFile)
    //biblioscape will respond to this closeing event, and initiate another
    //DDE link and send in command

    DDETERMINATE(hConv)
ELSE
    MESSAGEBOX(x; "ERROR"; "Biblioscape is not running, please start Biblioscape first."; IconQuestion!)
ENDIF

//HtmlPapUnformat
Application (WordPerfect; "WordPerfect"; Default; "US")
//First save the existing file as doc format
//FileSave ()
// Get file path and file name, so I know where to save the RTF file

myHTMFile = ?Path + strLeft(?Name; strPos(?Name; ".")) + "HTM"
//MESSAGEBOX(x; "test"; myRTFFile; IconInformation!)
//Then save the existing file as RTF format

FileSave (myHTMFile; ExportType: HTML!)
//Close the existing file
Close ()
//Check if Biblioscape is running, and open a DDE channel
//send the save RTF file fullName to let Biblioscape to process

hConv := DDEINITIATE("Biblioscape"; "DdeServerConv_scan")
IF(hConv) // IF hConv not equal to 0
    //open a chanel send the path, but do not respond in biblioscape, because
    //before closing the chanel, DDECommand send to word get no response

    DDEPOKE(hConv; "DdeServerItem_scan"; "WPWin; unformatHtmlToHtml; " + myHTMFile)
    //biblioscape will respond to this closeing event, and initiate another
    //DDE link and send in command

    DDETERMINATE(hConv)
ELSE
    MESSAGEBOX(x; "ERROR"; "Biblioscape is not running, please start Biblioscape first."; IconQuestion!)
ENDIF

//addTag 
Application (WordPerfect; "WordPerfect"; Default; "US")
hConv := DDEINITIATE("Biblioscape"; "DdeServerConv_scan")
IF(hConv) // IF hConv not equal to 0
    //open a chanel send the query, but do not respond in biblioscape, because
    //before closing the chanel, DDECommand send to word get no response

    GETSTRING(vStr; "Search reference using wildcards, logical operators, and search keywords."; 
   
   "Search for Reference")
    DDEPOKE(hConv; "DdeServerItem_scan"; "WPWin; searchRef; " + vStr)
    //biblioscape will respond to this closeing event, and initiate another
    //DDE link and send in command

    DDETERMINATE(hConv)
ELSE
    MESSAGEBOX(x; "ERROR"; "Biblioscape is not running, please start Biblioscape first."; IconQuestion!)
ENDIF

//convertGreek
Application (WordPerfect; "WordPerfect"; Default; "US")

ReplaceWithAttributes (State: No!)
ReplaceWithFontSize (State: No!)
ReplaceWithFont (State: Yes!; Name: "Symbol Regular"; Family: 2321; Attributes: FontMatchNormal!; Weight: 90; Width: 
WidthUnknown!; Source: DRSFile!; Type: TrueType!; CharacterSet: FontMatchASCII!)

SearchString (StrgToLookFor: "alpha")
ReplaceString (RplcStrg: "a")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "beta")
ReplaceString (RplcStrg: "b")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "gamma")
ReplaceString (RplcStrg: "g")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "delta")
ReplaceString (RplcStrg: "d")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "epsilon")
ReplaceString (RplcStrg: "e")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "zeta")
ReplaceString (RplcStrg: "z")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "eta")
ReplaceString (RplcStrg: "h")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "theta")
ReplaceString (RplcStrg: "q")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "iota")
ReplaceString (RplcStrg: "i")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "kappa")
ReplaceString (RplcStrg: "k")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "lambda")
ReplaceString (RplcStrg: "l")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "mu")
ReplaceString (RplcStrg: "m")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "nu")
ReplaceString (RplcStrg: "n")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "xi")
ReplaceString (RplcStrg: "x")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "omicron")
ReplaceString (RplcStrg: "o")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "pi")
ReplaceString (RplcStrg: "p")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "rho")
ReplaceString (RplcStrg: "r")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "sigma")
ReplaceString (RplcStrg: "s")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "tau")
ReplaceString (RplcStrg: "t")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "upsilon")
ReplaceString (RplcStrg: "u")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "phi")
ReplaceString (RplcStrg: "f ")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "chi")
ReplaceString (RplcStrg: "c")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "psi")
ReplaceString (RplcStrg: "y")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "omega")
ReplaceString (RplcStrg: "w")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

//now the captial
SearchString (StrgToLookFor: "ALPHA")
ReplaceString (RplcStrg: "A")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "BETA")
ReplaceString (RplcStrg: "B")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "GAMMA")
ReplaceString (RplcStrg: "G")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "DELTA")
ReplaceString (RplcStrg: "D")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "EPSILON")
ReplaceString (RplcStrg: "E")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "ZETA")
ReplaceString (RplcStrg: "Z")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "ETA")
ReplaceString (RplcStrg: "H")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "THETA")
ReplaceString (RplcStrg: "Q")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "IOTA")
ReplaceString (RplcStrg: "I")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "KAPPA")
ReplaceString (RplcStrg: "K")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "LAMBDA")
ReplaceString (RplcStrg: "L")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "MU")
ReplaceString (RplcStrg: "M")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "NU")
ReplaceString (RplcStrg: "N")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "XI")
ReplaceString (RplcStrg: "X")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "OMICRON")
ReplaceString (RplcStrg: "O")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "PI")
ReplaceString (RplcStrg: "P")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "RHO")
ReplaceString (RplcStrg: "R")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "SIGMA")
ReplaceString (RplcStrg: "S")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "TAU")
ReplaceString (RplcStrg: "T")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "UPSILON")
ReplaceString (RplcStrg: "U")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "PHI")
ReplaceString (RplcStrg: "F")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "CHI")
ReplaceString (RplcStrg: "C")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "PSI")
ReplaceString (RplcStrg: "Y")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

SearchString (StrgToLookFor: "OMEGA")
ReplaceString (RplcStrg: "W")
SearchCaseSensitive (State: Yes!)
SearchFindWholeWordsOnly (State: Yes!)
ReplaceForward (SearchMode: Extended!)

 


Last updated on August 01, 2008  E-mail us at support@biblioscape.com
© Copyright 1997-2008 CG Information All Rights Reserved