|
And what is your question?
|
|
|
|
|
I have a windows forms vb.net application (VS210) that automates a process simulator. I have an old version of the simulator application on my development machine, so I reference the com library at design time. However, my clients will have a newer version of the library. So, how do I use a config file to add the reference at runtime?
Maybe you can give an example or a reference. I couldn't understand what I got from Microsoft.
|
|
|
|
|
Hello dear everyone. I came up with creating an app that displaying the signal bar strength of the network that i am connected with. I can't find any site that guiding to code it in VB.Net so I unable to start with any of it. Could anyone suggest me which site that I can use to learn or maybe you can provide some suggestion on how to start with it? Thank you so much.
|
|
|
|
|
|
This is one of the forum that I think related to what I am looking for WMI to get SSID and signal strength information - Visual Basic .NET[^] but I am lost because I don't really know where to start. For example I don't understand about the WMI. I though it is clear enough if I mention about Display network signal strength using windows form application.
|
|
|
|
|
|
Sure, thanks
|
|
|
|
|
Hello everybody,
I could youse some help with VBA.
The case is: I have a folder with lots of Outlook .msg files and I need to extract their metadata like Subject, Sender and Send date to an Excel spreadsheet.
I am new in VBA and I would be very grateful for any advice you could give me! Thank you!
With Best Regards
Alex
|
|
|
|
|
I found this code:
Sub GetMailInfo()
Dim MyOutlook As Outlook.Application
Dim msg As Outlook.MailItem
Dim x As NameSpace
Dim Path As String
Dim i As Long
Set MyOutlook = New Outlook.Application
Set x = MyOutlook.GetNamespace("MAPI")
Path = "C:\Users\Alexander.Scott-Zhuk\Desktop\Messages\"
FileList = GetFileList(Path + "*.msg")
Row = 1
While Row <= UBound(FileList)
Set msg = x.OpenSharedItem(Path + FileList(Row))
Cells(Row + 1, 1) = msg.Subject
Cells(Row + 1, 2) = msg.SenderName
Cells(Row + 1, 3) = msg.SenderEmailAddress
Cells(Row + 1, 4) = msg.CC
Cells(Row + 1, 5) = msg.To
Cells(Row + 1, 6) = msg.SentOn
Cells(Row + 1, 7) = msg.Size
If msg.Attachments.Count > 0 Then
For i = 1 To msg.Attachments.Count
Cells(Row + 1, 7 + i) = msg.Attachments.Item(i).FileName
Next i
End If
Row = Row + 1
Wend
End Sub
Function GetFileList(FileSpec As String) As Variant
Dim FileArray() As Variant
Dim FileCount As Integer
Dim FileName As String
On Error GoTo NoFilesFound
FileCount = 0
FileName = Dir(FileSpec)
If FileName = "" Then GoTo NoFilesFound
Do While FileName <> ""
FileCount = FileCount + 1
ReDim Preserve FileArray(1 To FileCount)
FileArray(FileCount) = FileName
FileName = Dir()
Loop
GetFileList = FileArray
Exit Function
NoFilesFound:
GetFileList = False
End Function
But it doesn't work for me. When I run the macro I receive a runtime error message:
"runtime error 1004 method 'cells' of object '_global' failed"
and when I click debug it highlights this line:
Cells(Row + 1, 1) = msg.Subject
Do you have any clue, what am I doing wrong? Please help!
|
|
|
|
|
Are you running this from within an open Excel workbook?
|
|
|
|
|
Hello Richard,
no, I actually was running the macro from Outlook-VBA, but thank you for pointing me on that. I copied the code into the Excel-VBA and it worked perfectly! Thank you a lot!
But I still have the question, how do I make it work from Outlook and save it into Excel-File?
Alexander
|
|
|
|
|
At the beginning of the macro you have some code like:
Dim MyOutlook As Outlook.Application
Dim msg As Outlook.MailItem
Dim x As NameSpace
which starts the Outlook application and sets some references. If you want to run it from Outlook then you need some similar code that loads the Excel application and creates a new workbook. I do not know the exact code but take a look at Application Object (Excel)[^].
|
|
|
|
|
Ok thanks for your advise, I will look at this article closer.
|
|
|
|
|
Good day friends! Please, am currently working on a game and am having a challenge. I want enemies to appear smaller when far from the player and bigger when closer. Any solution is welcome please.
|
|
|
|
|
Since we know NOTHING AT ALL about your game, it's implementation, raster or vector graphics, ..., it's pretty much impossible for anyone to tell you anything useful.
Well...other than Google for "scaling 2d raster graphics" or something similar depending on your implementation.
|
|
|
|
|
Hello and thnx in advance for the help.
I have to send a packet of data, to the network broadcast, using UDP, to get the members of this particular intranet to respond (they are all PLCs).
I know the hex format of the message, say:
""43:44:50:00:01:00:00:00:00:00:00:00:00:ff:00:00:00:00:00:00:00:03:00:06:00:00:00:28:c0:a8:fc:fa:00"
colons are byte separators.
How do I pack it into the command MSG?
Dim myIP as IPAddress = "some.ip.addr.255"
Dim myPort as Integer = someport
private const myCmd as string = "43:44:50:00:01:00:00:00:00:00:00:00:00:ff:00:00:00:00:00:00:00:03:00:06:00:00:00:28:c0:a8:fc:fa:00"
dim HexSplit() as string = split(myCmd, ":")
dim byteCMD as byte() = new byte()
dim lCounter as integer
for each hS in HexSplit
byteCmd(lcounter) = CByte(Val("&H" + hS))
lcounter += 1
next
udpClient.Connect(myIP, myPort)
mRet = udpClient.Send(byteCmd, byteCmd.length)
|
|
|
|
|
I don't know, what you try to achieve and where your issue is ...
What does the Byte-Values from your Command-String mean ?
Which PLC's do you try to connect by this way ?
What kind of respond do you await ?
What should happen then ?
|
|
|
|
|
|
Hi Richard.
Interesting way to connect me.
I followed your link and posted a solution to this.
Thank you ...
|
|
|
|
|
|
Hi everyone.
I'm going to go directly to the question.
I am trying to create an app that creates a barcode and it's going to be copied to a PDF file, but that's not the problem:
I've all the code to create the barcode (the type is EAN-13) but the only thing that's missing is the size of it. By default, the size of the barcode generated with iTextSharp is really small. I have it in a PictureBox and I can change only the height of it, I need also the width and if it's possible, without losing quality.
Practically I obtain all the code from here: [^] . You can download the project if you want at the botton of that page.
So, finally, as I said, the question is that if there's any method to change the width or size (make it bigger) of the barcode without losing quality.
I think I don't forget nothing.
Thank you all in advance!
Bye.
modified 27-Jun-16 16:05pm.
|
|
|
|
|
Any assistance is appreciated,the code below just does not seem to update the textbox when button 1 is clicked. The script is split from a larger application just to give to highlight the issue.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a As New doSomething
Dim s As New Threading.Thread(AddressOf a.update)
s.IsBackground = True
s.Start()
End Sub
End Class
Public Class doSomething
Public Sub update()
SetControlText(Form1.TextBox1, "Hey Please Update the Textbox")
End Sub
Private Delegate Sub SetControlTextInvoker(ByVal ctl As Control, ByVal text As String)
Private Sub SetControlText(ByVal ctl As Control, ByVal text As String)
If ctl.InvokeRequired Then
ctl.Invoke(New SetControlTextInvoker(AddressOf SetControlText), _
ctl, _
text)
Else
ctl.Text = text
End If
End Sub
End Class
|
|
|
|
|
Try passing the real instance of Form1 to the doSomething class, rather than relying on the auto-created instance that only exists for VB6 compatibility.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a As New doSomething
a.Target = Me.TextBox1
Dim s As New Threading.Thread(AddressOf a.update)
s.IsBackground = True
s.Start()
End Sub
End Class
Public Class doSomething
Public Property Target As TextBox
Public Sub update()
SetControlText(Target, "Hey Please Update the Textbox")
End Sub
Private Shared Sub SetControlText(ByVal ctl As TextBox, ByVal text As String)
If ctl.InvokeRequired Then
ctl.Invoke(New Action(Of TextBox, String)(AddressOf SetControlText), ctl, text)
Else
ctl.Text = text
End If
End Sub
End Class
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i am trying to add records to database by Lynx grid, but i did not understand perfect code.
i googled also, but not find right example
Can any one give me best example
|
|
|
|
|
i am trying to add records to database by Lynx grid, but i did not understand perfect code.
i googled also, but not find right example
Can any one give me best example
|
|
|
|