dbTalk Databases Forums  

Office 2003

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Office 2003 in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter Newman
 
Posts: n/a

Default Office 2003 - 12-10-2003 , 03:15 AM






I have a DTS that is importing text files as a scheduled
task. I would like to be able to generate a word doc and
mail it to a list of clients. I know its possible under
Visual Basic, but has anybody managed to get a DTS
activex task to call a Word Document and print it.. ????

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Office 2003 - 12-10-2003 , 05:24 AM






Yes. You will need to use the Word object model. Office is not supported
in an unattended Server side implementation.

This works in Office 2K

Function Main()

Dim wrdApp
Dim wrdDoc
dim WHOLEDOCUMENT

set wrdApp = CREATEOBJECT("Word.Application")

Set wrdDoc =
wrdApp.Documents.Open(DTSGlobalVariables("gv_FileT oPrint").Value)

WHOLEDOCUMENT = 0

wrdDoc.PrintOut , ,WHOLEDOCUMENT, , , , ,
Cint(DTSGlobalVariables("gv_Copies").Value)


wrdDoc.Close

Set wrdDoc = Nothing

set wrdApp = nothing

Main = DTSTaskExecResult_Success
End Function




--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a DTS that is importing text files as a scheduled
task. I would like to be able to generate a word doc and
mail it to a list of clients. I know its possible under
Visual Basic, but has anybody managed to get a DTS
activex task to call a Word Document and print it.. ????



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.