Questions tagged [comobject]

200 questions
18
votes
2 answers

How do I remove all newlines from a string in PowerShell?

This is the code I am using to parse my emails. If they match a specific date, I want to add them to a list of other emails, then make that into a flat file: outfile = "C:\Temp\emails.csv" $olFolderInbox = 6 $ol = new-object -comobject…
EGr
  • 2,072
  • 10
  • 41
  • 61
14
votes
6 answers

How to get actual JavaScript value in onclick from webbrowser control?

I'm looking for a way to get the JavaScript code defined inside of onclick. I'm using .NET 2.0 C# Visual Studio 2005. Example: click here My goal is to get the string…
Meow
  • 18,371
  • 52
  • 136
  • 180
11
votes
3 answers

Automate (IE ComObject) Fill Textboxes

I'm Trying to Automate a Outlook Web Access website, fill some textboxes and click a buttons, I can find the relevant elements in the first page(sign-in) and the submit button, so i pass the login phase, my problem is to find the elements inside…
Avshalom
  • 8,657
  • 1
  • 25
  • 43
10
votes
2 answers

How return the type of a System.__COMObject in System.Type in C#

I'm doing a program and I want to do a Reflection, but for this, I need an Object of the Type class, right? to use the .GetProperties() method... So I tryed this: Type typeName = simObjects.getType(); But the .GetType() is returning…
Jovita
  • 153
  • 1
  • 2
  • 11
8
votes
1 answer

Microsoft.Office.Interop.Excel doesn't work on 64 bit

I've encountered a problem when developing on MS Visual Web Developer 2008 Express Ed. Developing ASP.NET C# on Windows7 64 bit OS. I'm trying to open an Excel document, but it gives me Old format or invalid type library. (Exception from HRESULT:…
Bush
  • 2,433
  • 5
  • 34
  • 57
8
votes
1 answer

Get process ID from Com Object

It is possible to get the Process ID from this new Com Object ($ie) ? $ie=New-Object -comobject InternetExplorer.Application $ie.visible=$true $ie.Navigate("www.stackoverflow.com")
LaPhi
  • 5,675
  • 21
  • 56
  • 78
7
votes
4 answers

Regsvr32 strange behaviour = > Regsvr32 does not give any success or failure message

I have an directShow filter: MyFilter.ax When I try to register MyFilter.ax with Regsvr32 utility it gives NO error or any message(success or failure). But the filter is not registered. Regsvr32 utility works fine for my other filters. Why…
Novalis
  • 2,265
  • 6
  • 39
  • 63
5
votes
2 answers

PowerShell Windows Installer Com Object

I'm trying to modify the contents of an MSI file using Powershell. To do so I create an instance of a WindowsInstaller.Installer then use $installer.OpenDatabase and $database.OpenView. Similar functionality works in VBScript and I've seen samples…
MattH
  • 1,975
  • 6
  • 24
  • 31
5
votes
2 answers

VS2010 will not display project properties ("underlying RCW")?

Only sometimes (I haven't yet noticed a pattern), VS2010 shows the following error (where I'd expect the body of the property page to be) when I right-click on a project (various types of projects) and select "Properties": I can typically view the…
lance
  • 16,092
  • 19
  • 77
  • 136
5
votes
2 answers

Leak in RuntimeBinder when using "dynamic" keyword with __ComObject

Does anybody know if there is a way of preventing a memory leak in RuntimeBinder when using "dynamic" keyword with __ComObject instances in C#? I got the following code: var t = Type.GetTypeFromCLSID(new…
Marcin Zawiejski
  • 1,123
  • 1
  • 9
  • 23
5
votes
3 answers

Word.Application ComObject errors in PowerShell

I'm unable to get a Word 2010 (14.0.x) document to SaveAs or Close using Powershell. From all the tuts online it seems like it should be working with 2.0, but I don't have that anymore. Simple case: $Path = "C:\MyDoc.docx" $Word = New-Object…
squid808
  • 1,430
  • 2
  • 14
  • 31
4
votes
1 answer

C# System.__ComObject returned when accessing Excel file

I am trying to access Excel file by code below: Microsoft.Office.Interop.Excel.Application ObjExcel = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel.Workbook book; Microsoft.Office.Interop.Excel.Worksheet…
Piotroslav
  • 252
  • 1
  • 4
  • 14
4
votes
1 answer

Loading .xls file with macros using PowerShell Core for Mac

I am trying to load an Excel file using PowerShell Core for Mac but I am encountering an issue with New-Object. It's failing on the very first line $Excel = New-Object -ComObject Excel.Application This is the error message I receive: New-Object :…
kevin02
  • 41
  • 2
4
votes
2 answers

Outlook/Powershell - Mail object truncating '.Body'

I am writing a script which will run an exe on a users machine, then prompt them to email the details back to me. The problem code is this: $ResultsOutput = "DHCPUtil Results at $(Get-Date) Computer Name : $([System.Environment]::MachineName) IP…
colsw
  • 3,216
  • 1
  • 14
  • 28
4
votes
1 answer

Powershell not looping over all comobjects

I am traversing a webpage and I need the value from a specific 'td' tag: $ie.Document.getElementsByTagName("td") And I get this: className : id : tagName : TD parentElement …
Derek Chadwell
  • 696
  • 1
  • 8
  • 22
1
2 3
13 14