?
Solved

to transfer string from C lanaguage to VBA

Posted on 2016-10-09
4
Medium Priority
?
119 Views
Last Modified: 2016-10-10
I would like to transfer the following code, written in C language, to VBA.

 Dim username As String
    Dim pin As String
    Dim broadcastType As String
    Dim phoneNumberSource As String
    Dim broadcastName As String
    Dim checkCallingWindow As String
    Dim commaDelimitedPhoneNumbers As String
    Dim TTSText As String

username = "999111999"
pin = "9991"
broadcastType = "1"
phoneNumberSource = "3"
broadcastName = "Test from Visual Basic"
checkCallingWindow = "0"
commaDelimitedPhoneNumbers = "9725551313"
TTSText = "Hello, This is a text to speech call testing integration with Microsoft Access 2016. Have a nice day."

Dim SoapPost As String
 
    SoapPost = "<?xml version=""1.0"" encoding=""utf-8""?> <soap12:envelope "
xmlns:            xsi = "&quot;http://www.w3.org/2001/XMLSchema-instance&quot;"
xml2ns:            xsd = "&quot;http://www.w3.org/2001/XMLSchema&quot;"
            xmlns:soap12="&amp;quot;http://www.w3.org/2003/05/soap-envelope&amp;quot;">&quot;_
    & "<soap12:body>" _
    & "<" & FunctionName & " xmlns="&quot;http://call-em-all.com/&quot;">" _
    & " <myRequest>" _
    & " <username>" & username & "</username>" _
    & " <pin>" & pin & "</pin>" _
    & " <phoneNumberSource>" & phoneNumberSource & "</phoneNumberSource>" _
    & " <broadcastName>" & broadcastName & "</broadcastName>" _
    & " <broadcastType>" & broadcastType & "</broadcastType>" _
    & " <checkCallingWindow>" & checkCallingWindow & "</checkCallingWindow>" _
    & " <commaDelimitedPhoneNumbers>" & commaDelimitedPhoneNumbers & "</commaDelimitedPhoneNumbers>" _
    & " <TTSText>" & TTSText & "</TTSText>" _
    & " </myRequest>" _
    & "</" & FunctionName & ">" _
 & "</soap12:Body>" _
    & "</soap12:Envelope>"

Open in new window


I would appreciate help in transferrring the above string to VBA or to VB.net.
Thank you in advance.
0
Comment
Question by:Moshe Singer
  • 2
4 Comments
 
LVL 37

Expert Comment

by:Pawan Kumar
ID: 41836080
Is that you are looking for..

SoapPost = "<?xml version="
 "1.0"
 " encoding="
 "utf-8"
 "?> <soap12:envelope "
xmlns:
     xsi = ""http://www.w3.org/2001/XMLSchema-instance""
xml2ns:
     xsd = ""http://www.w3.org/2001/XMLSchema""
xmlns:
     soap12 = ("&quot;http://www.w3.org/2003/05/soap-envelope&quot;" > quot)
     (_ And "<soap12:body>")
     (_ And ("<"  _
                 And (FunctionName And (" xmlns=" And quot))))
 http:
     'call-em-all.com/"">" _
     " <myRequest>"
     (_ And (" <username>"  _
                 And (username And "</username>")))
     (_ And (" <pin>"  _
                 And (pin And "</pin>")))
     (_ And (" <phoneNumberSource>"  _
                 And (phoneNumberSource And "</phoneNumberSource>")))
     (_ And (" <broadcastName>"  _
                 And (broadcastName And "</broadcastName>")))
     (_ And (" <broadcastType>"  _
                 And (broadcastType And "</broadcastType>")))
     (_ And (" <checkCallingWindow>"  _
                 And (checkCallingWindow And "</checkCallingWindow>")))
     (_ And (" <commaDelimitedPhoneNumbers>"  _
                 And (commaDelimitedPhoneNumbers And "</commaDelimitedPhoneNumbers>")))
     (_ And (" <TTSText>"  _
                 And (TTSText And "</TTSText>")))
     (_ And " </myRequest>")
     (_ And ("</"  _
				And (FunctionName And ">")))
	 (_ And ("</soap12:Body>")
	 (_ And ("</soap12:Envelope>")

Open in new window

0
 

Author Comment

by:Moshe Singer
ID: 41836178
I tested, it cannot be compiled from the debug menu
it is full with errors
0
 
LVL 9

Accepted Solution

by:
Karen earned 2000 total points
ID: 41836312
SoapPost = "<?xml version=""1.0"" encoding=""utf-8""?> <soap12:envelope " _
    & "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" " _
    & "xml2ns:xsd=""http://www.w3.org/2001/XMLSchema"" " _
    & "xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope""> " _
    & "<soap12:body>" _
    & "<" & FunctionName & " xmlns=""http://call-em-all.com/"">" _
    & " <myRequest>" _
    & " <username>" & UserName & "</username>" _
    & " <pin>" & pin & "</pin>" _
    & " <phoneNumberSource>" & phoneNumberSource & "</phoneNumberSource>" _
    & " <broadcastName>" & broadcastName & "</broadcastName>" _
    & " <broadcastType>" & broadcastType & "</broadcastType>" _
    & " <checkCallingWindow>" & checkCallingWindow & "</checkCallingWindow>" _
    & " <commaDelimitedPhoneNumbers>" & commaDelimitedPhoneNumbers & "</commaDelimitedPhoneNumbers>" _
    & " <TTSText>" & TTSText & "</TTSText>" _
    & " </myRequest>" _
    & "</" & FunctionName & ">" _
    & "</soap12:Body>" _
    & "</soap12:Envelope>"

Open in new window

0
 

Author Closing Comment

by:Moshe Singer
ID: 41837442
now it is error free
I have to test if it is working
Thanks a milion
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question