UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Open Word Document Using Vbscript, 2013    
 
   
bakersburg9
post Sep 16 2017, 07:57 PM
Post#1



Posts: 4,864
Joined: 2-November 04
From: Downey, CA


The following .vbs file opens Google and Yahoo

CODE
REM Open GMAIL
set sh2=createObject("Wscript.shell")
sh2.run "https://mail.google.com/mail/u/0/#inbox"

REM Open Yahoo
set sh1=createObject("Wscript.shell")
sh1.run "https://login.yahoo.com/account/challenge/push?.src=ym&.intl=us&.lang=en-US&authMechanism=primary&yid=ironwood9&done=https%3A%2F%2Fmail.yahoo.com%2F&as=1&login=ironwood9&crumb=1u1HNDLMR1J&display=login&dname=ironwood9&s=QQ--&sessionIndex=QQ--&c=5QeICVL.2cK13Uk1ZmoDryXruwRuy.JhiSk7KMD26IzSqpcqLGrWMVg5_623jwgyUC4G.VxIhQ
1IkuvKjyUESub1orU0xWURPyOz04ADKwTbfcP0fanbndTCZZ8GVuy7oEVv2xw6GyQdt_TxJWnYvXpy5Di
94zM3OnG9B48I4Mxd5vgv0RqkPw8owYRZs_eMjr5UnTqZ_w.jlQqGBn0q8OO9iM4IkeTanoxPQ1MGDzuG
TfACOflsPAc3vFe8MWkxDxZrxeNmpirI0JXEmLkbfneugPA8RYZUqVFE0VHTdeKSdb6ThRz0g6SRsLliF
N0amf.Aa94WpyhXKzrDlmTRcTI8HCFwDGlS3K_5Gx0lUge57AGI55icEfilunHNMShznHEvYSIrEkdM8D
5blMY-~A&acrumb=7Hkb4bev"


How would I also open a Word Document, say on C:\MyFiles ?
Go to the top of the page
 
Doug Steele
post Sep 16 2017, 09:33 PM
Post#2


UtterAccess VIP
Posts: 21,357
Joined: 8-January 07
From: St. Catharines, ON (Canada)


This worked for me:

CODE
Dim sh2
  
  Set sh2 = CreateObject("Wscript.shell")
  sh2.run "D:\Users\Doug\Documents\Affiliations.docx"

(of course, you need to have Word, or some other application that's set to open .docx files, installed!)

--------------------
Go to the top of the page
 
bakersburg9
post Sep 17 2017, 11:07 AM
Post#3



Posts: 4,864
Joined: 2-November 04
From: Downey, CA


Doug,
Thanks !!! cool.gif
Go to the top of the page
 
bakersburg9
post Sep 19 2017, 11:59 AM
Post#4



Posts: 4,864
Joined: 2-November 04
From: Downey, CA


Hmmm... didn't work - maybe operator error, but any idea why?

I saved and ran as .vbs and .bat - the VBscript did nothing - with the batch file, I saw code running on the screen, but nothing happened...

Thanks for your input cool.gif

Steve
Go to the top of the page
 
Doug Steele
post Sep 19 2017, 12:02 PM
Post#5


UtterAccess VIP
Posts: 21,357
Joined: 8-January 07
From: St. Catharines, ON (Canada)


No idea. It worked for me.

I assume you've got a default action set up for .docx file extensions.

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th October 2017 - 06:21 AM