So I'm trying to do some as400 automation and hit a wall when trying to get a COM object. The code on line 8 is failing, the as400.ws file opens with PCSWS.exe so I tried using that as the file path too but that didn't work either. Any and all help is greatly appreciated!
$file = "C:\Users\Rhidlor\Desktop\as400.ws" If Not FileExists($file) Then MsgBox(0, "Error", "Error finding file") Exit EndIf $object = ObjGet($file) If @error Then MsgBox(0, "Error", "Error getting object") Exit EndIf $object.SendKeys("05")
I have a Word document containing a 9-column table where row 1 is the column headers. My goal is to read the table into a 2d array, remove some rows, update some fields, and add a few rows to the end. The resulting array will likely be a different length. Next, I want to write the data back into the table. If it's easier, I can write the data to a new document from a template containing the same table header with a blank 2nd row.
Here's my early attempt:
Local $oWord = _Word_Create() Local $oDoc = _Word_DocOpen($oWord, $sFile) Local $aData = _Word_DocTableRead($oDoc, 1) $aData = "Something else" Local $oRange = _Word_DocRangeSet($oDoc, 0) $oRange = _Word_DocRangeSet($oDoc, $oRange, $wdCell, 9) _Word_DocTableWrite($oRange,$aData) This, unfortunately, writes the entire array into the first cell of row 2. What am I doing wrong?
; NetFirewallPolicy2 COM UDF Library for AutoIt3
; AutoIt Version : 188.8.131.52
; Description ...: Windows Firewall Policy2 Interface, Provides access to the firewall policy for Windows Vista+
Including Test Script
_NetFw_Get_CurrentProfileTypes Retrieves the currently active firewall profile(s) _NetFw_Get_FirewallEnabled Indicates whether a firewall is enabled locally _NetFw_Put_FirewallEnabled Specifies whether a firewall is enabled locally _NetFw_Get_ExcludedInterfaces Indicates a list of interfaces on which firewall settings are excluded _NetFw_Put_ExcludedInterfaces Specifies a list of interfaces on which firewall settings are excluded _NetFw_Get_BlockAllInboundTraffic Indicates whether the firewall should not allow inbound traffic _NetFw_Put_BlockAllInboundTraffic Specifies whether the firewall should not allow inbound traffic _NetFw_Get_NotificationsDisabled Indicates whether interactive firewall notifications are disabled _NetFw_Put_NotificationsDisabled Specifies whether interactive firewall notifications are disabled _NetFw_Get_UnicastResponsesToMulticastBroadcastDisabled Indicates whether the firewall should not allow unicast responses to multicast and broadcast traffic _NetFw_Put_UnicastResponsesToMulticastBroadcastDisabled Specifies whether the firewall should not allow unicast responses to multicast and broadcast traffic _NetFw_Get_Rules Retrieves the interface to collection of firewall rules _NetFw_Get_ServiceRestriction Retrieves the interface used to access the Windows Service Hardening store _NetFw_EnableRuleGroup Enables or disables a specified group of firewall rules _NetFw_IsRuleGroupEnabled Determines whether a specified group of firewall rules are enabled or disabled for the current profile _NetFw_RestoreLocalFirewallDefaults Restores the local firewall configuration to its default state _NetFw_Get_DefaultInboundAction Indicates the default action for inbound traffic _NetFw_Put_DefaultInboundAction Specifies the default action for inbound traffic _NetFw_Get_DefaultOutboundAction Indicates the default action for outbound traffic _NetFw_Put_DefaultOutboundAction Specifies the default action for outbound traffic _NetFw_Get_IsRuleGroupCurrentlyEnabled Determines whether a specified group of firewall rules are enabled or disabled for the current profile _NetFw_Get_LocalPolicyModifyState Determines if adding or setting a rule or group of rules will take effect in the current firewall profile
Our Microsoft Office Templates shared folder was changed from a DFS share to an Isilon share. example:
Old Server: \\Domain.com\Office\Templates
New Server: \\Templates.domain.com\Office\Templates
The team making the changes overlooked that several hundred thousand documents, had been attached to the old template documents. So when you open a document which has been attached, it will take a couple of minutes to open, while it tries to locate the old server path. I've been asked to come in and fix it, so after several hours found that the data is being held in document.zip\word\_rels\settings.xml.rels, I now need to replace the old server path with the new server path. I didn't want to use dom as that would take too long and found a tool wtc https://github.com/NeosIT/wtc which works perfectly, takes about 8 minutes to scan a single directory with 4000 documents and fix them. The problem is the documents are all held on sharepoint and they want to retain the file timestamp, which is easy enough, but they also don't want to keep the "Modified By" apparently they don't like seeing all the documents appearing as "Modified by: Subz" Anyone know of way to retain the "Modified By" info,
Good evening everyone
I am working with Word UDF ( thanks @water! ), and, especially, with the function _Word_DocFindReplace().
The replace does work everywhere in the document, but, it does not work in Headers or Footers.
Am I missing something or am I forced to use the code below?
I have already looked in the Help file ( about _Word_DocFindReplace() ), but there are no mentions about replace text in Headers/Footers.
Sub FindAndReplaceFirstStoryOfEachType() Dim rngStory As Range For Each rngStory In ActiveDocument.StoryRanges With rngStory.Find .Text = "find text" .Replacement.Text = "I'm found .Wrap = wdFindContinue .Execute Replace:=wdReplaceAll End With Next rngStory End Sub Thanks everyone in advance