vbscript

How can I replicate programmatically in VBS what Word does when I insert a “built-in” property from the Insert->QuickPart->Document Property dropdown?

元气小坏坏 提交于 2020-08-08 07:00:07
问题 In Microsoft Word (Windows desktop version from around 2007 and later), I can use the Insert Tab, Text group, Explore Quick Parts dropdown, Document Property dropdown to insert a Content Control that allows display/entry/selection of the value of one of a number of types of Document Property , which might be one of the following: Built-in document properties "Content Type" metaproperties associated with a server such as Microsoft's SharePoint server How can I do programmatic insertion of

VBScript to run a file from desktop (any user)

ⅰ亾dé卋堺 提交于 2020-08-08 05:29:28
问题 I've created a VBScript to run a macro from excel without opening the file. Set objExcel = CreateObject("Excel.Application") objExcel.Application.Run "'C:\Users\MyUser\Desktop\RM.xlsm'!Module4.Email" objExcel.DisplayAlerts = False objExcel.Application.Quit Set objExcel = Nothing I want to use this VBScript & XLSM file on different computers, so how can i change this script to work without editing the path every time? (Maybe a code to run from current folder or a code to run from any user

How can I resolve MSI paths in VBScript?

拈花ヽ惹草 提交于 2020-08-05 07:52:08
问题 I am looking for resolving the paths of files in an MSI with or without installing (whichever is faster) from outside an MSI, using VBScript. I found a similar query using C# instead and Christpher had provided a solution, below: How can I resolve MSI paths in C#? I am going through the very same pain now but is there anyway to achieve this using WindowsInstaller object in VBScript, rather than go with endless queries through SQL Tables of MSI back and forth to achieve the same. Though any

Convert *.xls or *.xlsx file to pipe separated .csv file using command line

南楼画角 提交于 2020-08-05 05:29:08
问题 I have an .xlsx file like this: sample.xlsx: Heading C1 C2,01,02 C3 C4 R1 1 4 7 10 R2 2 5 8 11,1 R3 3 6 9,0 12 I want to convert sample.xlsx file into Output.csv file [pipe separated]. Please note that I don't want any double quotes "C2,01,02". Output.csv: Heading|C1|C2,01,02|C3|C4 R1|1|4|7|10 R2|2|5|8|11,1 R3|3|6|9,0|12 I know how to produce Output.csv using manual steps like this: Goto control panel -> Region and Language -> Additional Settings -> update list separator field with pipe "|".

Convert *.xls or *.xlsx file to pipe separated .csv file using command line

一笑奈何 提交于 2020-08-05 05:29:05
问题 I have an .xlsx file like this: sample.xlsx: Heading C1 C2,01,02 C3 C4 R1 1 4 7 10 R2 2 5 8 11,1 R3 3 6 9,0 12 I want to convert sample.xlsx file into Output.csv file [pipe separated]. Please note that I don't want any double quotes "C2,01,02". Output.csv: Heading|C1|C2,01,02|C3|C4 R1|1|4|7|10 R2|2|5|8|11,1 R3|3|6|9,0|12 I know how to produce Output.csv using manual steps like this: Goto control panel -> Region and Language -> Additional Settings -> update list separator field with pipe "|".

Able to open a specific jupyter notebook from command line but not able to execute

好久不见. 提交于 2020-08-03 09:39:09
问题 Am trying to open and execute .ipynb file from command line, i created a vb script for this. It is below. Set WinScriptHost = WScript.CreateObject("WScript.Shell") WinScriptHost.Run "C:\Users\vevek.seetharaman\AppData\Local\Continuum\anaconda3\Scripts\activate.bat & jupyter notebook C:\Users\vevek.seetharaman\Downloads\Notebooks\MouseMovements.ipynb --notebook-dir=C:\Users\vevek.seetharaman\Downloads\ScriptAutomation\Notebooks", 1 Set WinScriptHost = Nothing Mouse Movements.py is the name of

How to loop through the weeks in a date range with vba

 ̄綄美尐妖づ 提交于 2020-07-24 04:54:48
问题 I have seen how to loop through weeks of a year, w1301,w1302,w1303, I can get the week number if i loop through + on week number but I believe there is a way to directly loop weekly with vba, i hope at least. DateSerial(Year(Now), Month(Now), Day(Now)) To DateSerial(2013, 3, 1) StartDate = #1/1/2013# EndDate = #12/31/2013# For DateLooper = StartDate To EndDate I got the function for a week number from date Public Function IsoWeekNumber(d1 As Date) As Integer Attributed to Daniel Maher Dim d2

How to loop through the weeks in a date range with vba

删除回忆录丶 提交于 2020-07-24 04:52:52
问题 I have seen how to loop through weeks of a year, w1301,w1302,w1303, I can get the week number if i loop through + on week number but I believe there is a way to directly loop weekly with vba, i hope at least. DateSerial(Year(Now), Month(Now), Day(Now)) To DateSerial(2013, 3, 1) StartDate = #1/1/2013# EndDate = #12/31/2013# For DateLooper = StartDate To EndDate I got the function for a week number from date Public Function IsoWeekNumber(d1 As Date) As Integer Attributed to Daniel Maher Dim d2

Alternative for WScript.Sleep and window.timeout [duplicate]

和自甴很熟 提交于 2020-07-22 06:14:18
问题 This question already has answers here : Is the Sleep operation no longer used in VBscript? (3 answers) How to set delay in vbscript (11 answers) Closed last year . I am writing a VBScript for an application that runs on an industrial controller which does not support WScript . The controller has a single thread for processing VBScript and I need to pause my script for only a few program scans to allow another event handler to process. VBScript is processed in a WSH shell. If I run a MsgBox

Running VBA macro within Access 2010 from external VBScript

 ̄綄美尐妖づ 提交于 2020-07-21 04:20:07
问题 Not sure this is possible, but it seems like it should be doable.... it is 2013 after all! And some forum posts I found suggest it is, but I have not been successful in getting it to work... I have an Access 2010 db with a macro that downloads files from 3 different web sites and then proceeds to import the data and process it. It runs for 1hr and 17 mins. I want to schedule this macro to run at 4am so it is all done and dusted by coffee time and work start 8am... So I created a VBScript to