Creating a new word document Set wrd = CreateObject("Word.Application") wrd.Documents.Add wrd.Visible = True Setting the start up path wrd.Options.DefaultFilePath(wdStartupPath) = "c:\user\" Quitting word wrd.Quit Starting word from another app Set wrd = CreateObject("Word.Application") Create and launch another app from Word Set myobject = CreateObject("Excel.Application") MsgBox myobject.StartupPath Set myobject = Nothing Using DDE Channel to send data to another app, like excel: Dim lngChannel As Long lngChannel = DDEInitiate(App:="Excel", Topic:="System") DDEExecute Channel:=lngChannel, Command:="[OPEN(" &; Chr(34) _ &; "C:\NameOfExcelFile.xls" &; Chr(34) &; ")] DDETerminate Channel:=lngChannel lngChannel = DDEInitiate(App:="Excel", Topic:="NameOfExcelFile.xls") 'Go to row 1 column 1 and key in data DDEPoke C...
Comments
Post a Comment