How to Use Microsoft Word

  • Thread starter progresscommunities@progr
  • Start date
Status
Not open for further replies.
P

progresscommunities@progr

Guest
I have been able to get a number of word feature working but need help on some others. Below is what works.I need to set the pages to 2 columns, I need to create a table of contents, put page numbers on each page, set the font and size, and save file using defined name. Any help would be greatly appreciated.DEFINE VARIABLE vchWordApp AS COM-HANDLE. DEFINE VARIABLE vchWordDoc AS COM-HANDLE.CREATE "Word.Application" vchWordApp. /* Create handle for Excel */ vchWordApp:Visible = TRUE. /* Set to False if not to be seen */ vchWordApp:Documents:ADD(). vchWordDoc = vchWordApp:ActiveDocument. /* Setup Landscape */ vchWordDoc:pageSetup:Orientation = 1. /* Set document to 2 columns *//* vchWordDoc:TextColumns:ADD(50,,). DOES NOT WORK */* THIS IS CODE FROM THE MACRO IN WORD /* Setup Columns in Document */ With Selection.PageSetup.TextColumns .SetCount NumColumns:=2 .EvenlySpaced = True .LineBetween = False .Width = InchesToPoints(9) End With *//* Setup Table of Contents *//* vchWordApp:TableOfContents:ADD(,,,,,,,,,,). DOES NOT WORK *//* THIS IS CODE FROM THE MACRO IN WORDActiveDocument.AttachedTemplate.BuildingBlockEntries("Automatic Table 1"). _ Insert Where:=Selection.Range, RichText:=True */ /* Add page numbers at the bottom of the page *//* vchWordApp:BuildingBlockEntries:ADD("Bold Numbers 3",,,,,). DOES NOT WORK *//* THIS IS CODE FROM THE MACRO IN WORDWordBasic.ViewFooterOnly ActiveDocument.AttachedTemplate.BuildingBlockEntries("Bold Numbers 3"). _ Insert Where:=Selection.Range, RichText:=True*//* ....... missing code to loop through data */chWordApp:Selection:Style = "Heading 1". /* can use "Heading 2" and "Heading 3" */ vchWordApp:Selection:typetext(WORKITEM.WCLASS). vchWordApp:Selection:TypeParagraph/* ........ missing code - this is the detail lines */vchWordApp:Selection:Style = "No Spacing". vchWordApp:Selection:typetext(WORKITEM.WDESC). vchWordApp:Selection:TypeParagraph./* vchWordApp:UpdateTableOfContents. ----- DOES NOT WORK - AT LEAST IT WILL NOT UNTIL IT IS CREATED */vchWordApp:Documents:SAVEAS(FILE-NAME,,,,,,,,,,). /* THIS FAILS EVERY TIME */vchWordApp:QUIT().RELEASE OBJECT vchWordApp

Continue reading...
 
Status
Not open for further replies.
Top