Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
can i modify a doc file with vbs?
Logged in as: Guest
arrSession:exec spGetSession 2,2,34451
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> can i modify a doc file with vbs?
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
can i modify a doc file with vbs? -
5/12/2006 3:53:25 PM
barocco
Posts: 49
Score: 0
Joined: 4/24/2005
From:
Status:
offline
can i modify a doc file with vbs?
_____________________________
Godness light my path
Post #: 1
RE: can i modify a doc file with vbs? -
5/12/2006 5:36:32 PM
DiGiTAL.SkReAM
Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status:
offline
Sure thing.
Well, as long as you have word installed:
This code is taken directly from the Portable Script Center by the Scripting Guys at Technet.
This can be used to open and print a word document:
Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open("c:\scripts\inventory.doc") objDoc.PrintOut() objWord.Quit
And this can be used to add formatted text to a word doc
Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection objSelection.Font.Name = "Arial" objSelection.Font.Size = "18" objSelection.TypeText "Network Adapter Report" objSelection.TypeParagraph() objSelection.Font.Size = "14" objSelection.TypeText "" & Date() objSelection.TypeParagraph()
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers)
"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury
(in reply to
barocco
)
Post #: 2
RE: can i modify a doc file with vbs? -
5/16/2006 12:48:08 AM
barocco
Posts: 49
Score: 0
Joined: 4/24/2005
From:
Status:
offline
many thanks!That's just what i want!
_____________________________
Godness light my path
(in reply to
DiGiTAL.SkReAM
)
Post #: 3
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> can i modify a doc file with vbs?
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI