Some usefull DDE information
Posted in 2005
Hi guys - just in case someone is interested in DDE/Office connectivity, here is a list of usefull DDE commands for MS-Word and Excel (2000,XP,....) which I found on the internet.... If you know of any which are not listed here, it would be great if you could email me them - THANKS - Hubert ############################################################### MS-Word ############################################################### (DdeExecute) Command Description [FileNew] Creates a new empty document [FileNew .NewTemplate = 0, .Template = Template$] Creates a new document or template.NewTemplate = 0 (or omitted) = new document 1 New template.Template = The name of the template or document on which to base the new document or template, or the name of the wizard to run. You *must* specify the complete path to the template file. [FileSaveAs 'c:\\temp\\test.doc", 0] Save active document as "c:\\temp\\test.doc" [FileSave] Save active document [FileClose] Close active document [FileExit Mode] Quits Winword. Mode:0 Prompts the user to save documents1 Saves all edited documents before quitting.2 Quits without saving changed documents. [FilePrintDefault] Prints the active document using the current settings in the Print and Print Setup dialog boxes (File menu) and on the Print tab in the Options dialog box (Tools menu). [InsertPicture("c:\\pic1$$$$.bmp")] Inserts picture file at current cursor position [Insert("Hello")] Inserts text "Hello" [Insert "Hi HTBasic users"] Inserts text "Hi HTBasic users" [InsertFrame] Inserts an empty frame, or frames the selected text, graphic, or both. If there is no selection, Word inserts a 1-inch - square frame at the insertion point (the frame appears as a square in page layout view). You can change the dimensions of the frame with FormatFrame. [RemoveFrames] Removes all frames in the selection. Note that borders, applied automatically when you insert a frame around text, are not removed. [FormatBordersAndShading.Shadow=1,.TopBorder=1, .LeftBorder=1, .BottomBorder=1, .RightBorder=1, .ApplyTo=0] Sets border and shading formats for the selected paragraphs, table cells, or graphic. The arguments for the FormatBordersAndShading statement correspond to the options in the Borders And Shading dialog box (Format menu)..Shadow Specifies whether to apply a shadow to the border of paragraphs or a graphic:0 (zero) Does not apply a shadow.1 Applies a shadow.You cannot apply a shadow to a table or table cells. If you want to apply a shadow to a paragraph or graphic, the item must have---or you must specify---matching right, left, top, and bottom borders. Otherwise, an error occurs..TopBorder, .LeftBorder, .BottomBorder, .RightBorder The line style for the border on the top, left, bottom, and right edges of paragraphs, cells, or a graphic, in the range 0 (zero), which is no border, through 11 (for a list of line styles and their values, see BorderLineStyle)..ApplyTo If the selection consists of more than one of the following items, specifies to which item or items the border format is applied:0 (zero) Paragraphs1 Graphic2 Cells3 Whole tableIf .ApplyTo is omitted, the default for the selection is assumed..TopColor, .LeftColor, .BottomColor, .RightColor, .HorizColor, .VertColor The color to be applied to the specified borders, in the range from 0 (zero), which is Auto, through 16 (for a list of colors and their values, see CharColor). [InsertBreak.Type=x] Inserts a break. .Type values:0 (zero) or omitted Page break1 Column break2 Next Page section break3 Continuous section break4 Even Page section break5 Odd Page section break6 Line break (newline character) [InsertDateTime .InsertAsField = number] Inserts the current date, time, or both, as either text or a TIME field. .InsertAsField Specifies whether Word inserts the information as a TIME field:0 (zero) Word inserts the information as text.1 Word inserts the information as a TIME field.Omitted Word inserts the information according to the current setting of the Insert As Field check box in the Date And Time dialog box (Insert menu). [InsertPageNumbers .Type = 0, .Position = 2, .FirstPage = 0] Inserts page number into the header or footer..Type: 0 = header, 1= footer.Position: 0 = Left, 1=Center, 2=Right3=Inside (left on odd pages, right on even pages)4=Outside (right on odd pages, left on even pages).Firstpage: If 1, the field is included in the header or footer on the first page. [TableInsertTable .NumColumns = 3, .NumRows = 5, .Format=xx] Inserts a table with .NumColumns columns and .NumRows rowsAdditional parameter: .Format=xxwhere xx = One of the predefined formats listed in the Table AutoFormat dialog box (Table menu): 0 (zero) corresponds to the first format listed in the Formats box ("none"), 1 corresponds to the second format, and so on. [TableDeleteColumn] Deletes the table column containing the insertion point, or deletes all columns containing part of the selection. If the insertion point or selection is not within a table, an error occurs. [TableDeleteRow] Deletes the row containing the insertion point, or deletes all rows containing part of the selection. If the insertion point or selection is not within a table, an error occurs. [TableDeleteCells .ShiftCells = number] Deletes the selected cells. If the insertion point or selection is not within a table, an error occurs..ShiftCells: Sets the direction to shift the remaining cells:0 (zero) Shift the cells left.1 Shift the cells up.2 Delete the entire row.3 Delete the entire column. [TableSelectTable] Selects the entire table containing the insertion point. If the insertion point or selection is not in a table, an error occurs. As the examples in this entry demonstrate, you can use TableSelectTable in combination with other WordBasic statements to move the insertion point reliably to the first cell in a table or to the first character after a table. [InsertPara] Inserts a paragraph mark at the insertion point. [Bold][Bold 1][Bold 0] Toggles bold stateSwitches on Bold stateSwitches off Bold state [NextCell][PrevCell] Selects the contents of the next table cellSelects the contents of the previous table cell [Underline][Underline 1] & [Underline 0] see above Toggles underline state [Italic][Italic 1] / [Italic 0] see above Toggles italic state [DottedUnderline][DottedUnderline 1] / [DottedUnderline 0] see above Toggles dottedunderline state [DoubleUnderline][DoubleUnderline 1] / [DoubleUnderline 0] see above Toggles dottedunderline state [FormatFont("15")] Sets font size to 15 points [Font("Arial")] Selects font "Arial" [CharColor x] Sets color of characters to value x. Range: 0..16Values0=Auto, specified in the Control Panel (Windows)1=Black, 2=Blue, 3=Cyan, 4=Green, 5=Magenta, 6=Red, 7=Yellow, 8=White, 9=Dark Blue, 10=Dark Cyan, 11=Dark Green, 12=Dark Magenta, 13=Dark Red, 14=Dark Yellow, 15=Dark Gray, 16=Light Gray [ResetChar x] 0 (zero) If the selected text contains any manual character formatting1 If the selected text contains no manual character formatting [NormalStyle] Applies the Normal style to the selected paragraphs [Style Style$] Applies a style to the selected paragraphs.Example: [Style "Heading 1"] FormatStyle .Name = "TestMe", .DefineFormatDefineStyleFont .Points = "10", .Bold = 1, .SmallCaps = 1 .Name The name of the style..Delete Deletes the specified style..BasedOn Specifies an existing style on which to base the specified style..Type specifies the type for a new style,: 0 (zero) or omitted Paragraph 1 Character.FileName The document or te