Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
QuestionStart up with windows Pin
shdelpiero8-Nov-05 10:20
shdelpiero8-Nov-05 10:20 
AnswerRe: Start up with windows Pin
Jon Rista8-Nov-05 10:29
Jon Rista8-Nov-05 10:29 
QuestionHelp ,Please. Pin
shdelpiero8-Nov-05 10:13
shdelpiero8-Nov-05 10:13 
AnswerRe: Help ,Please. Pin
MoustafaS8-Nov-05 13:28
MoustafaS8-Nov-05 13:28 
QuestionDetecting Controls Under Mouse Cursor With Click and Drag Pin
redfish348-Nov-05 8:59
redfish348-Nov-05 8:59 
AnswerRe: Detecting Controls Under Mouse Cursor With Click and Drag Pin
Jon Rista8-Nov-05 10:25
Jon Rista8-Nov-05 10:25 
GeneralRe: Detecting Controls Under Mouse Cursor With Click and Drag Pin
redfish3410-Nov-05 11:10
redfish3410-Nov-05 11:10 
QuestionPassing data from WORD to a Web Page Pin
DenMelton8-Nov-05 8:34
DenMelton8-Nov-05 8:34 
OK, I have created an AddIN for MS Word, which takes the content of the document, and saves it to a variable...
Microsoft.Office.Interop.Word.Application my_app = (Microsoft.Office.Interop.Word.Application) applicationObject;
Microsoft.Office.Interop.Word.Document my_doc = my_app.ActiveDocument;
my_doc.Select();
my_app.Selection.Copy();
string myText = my_app.Selection.Text;
(the above code works great)

I tried using the Navigate() to send the data to our web application, but I am unable to retrieve it when the Webpage opens:

string strPostData = "SomeData=" + myText;
object strPostHeader = "content-Type:application/x-www-form-urlencode";
string strLocation = "http://mysite.devsite.com/zTest.cfm";
object strTarget = "_BLANK";
System.Object null_obj = 0;

byte[] results;
results = UnicodeToAscii(strPostData);

SHDocVw.InternetExplorer webPost = new SHDocVw.InternetExplorer();
webPost.Navigate(strLocation, ref null_obj, ref strTarget, ref results, ref strPostHeader);


****This is the conversion method*****

public byte[] UnicodeToAscii(string src)
{
int len = src.Length;
byte[] result = new Byte[len + 1];

for (int i = 0; i < len; i++)
result[i] = Convert.ToByte(src[i]);
result[len] = 0;

return result;
}

I keep getting "Argument 4:cannot convert 'ref byte[]' to 'ref object'"

and if I just cast strPostData to an object, the Webpage loads, but nothing is passed in...

Confused? Yes!
AnswerRe: Passing data from WORD to a Web Page Pin
K edar V18-Oct-06 20:11
K edar V18-Oct-06 20:11 
QuestionTEXTBOX HELP!!! Pin
dgap8-Nov-05 8:07
dgap8-Nov-05 8:07 
AnswerRe: TEXTBOX HELP!!! (REDO) Pin
dgap8-Nov-05 8:09
dgap8-Nov-05 8:09 
GeneralRe: TEXTBOX HELP!!! (REDO) Pin
Susan Hernandez9-Nov-05 14:52
Susan Hernandez9-Nov-05 14:52 
QuestionWork with ASCII code... Pin
ventomito8-Nov-05 8:04
ventomito8-Nov-05 8:04 
AnswerRe: Work with ASCII code... Pin
Dan Neely8-Nov-05 8:36
Dan Neely8-Nov-05 8:36 
GeneralRe: Work with ASCII code... Pin
ventomito8-Nov-05 9:21
ventomito8-Nov-05 9:21 
GeneralRe: Work with ASCII code... Pin
lmoelleb8-Nov-05 21:44
lmoelleb8-Nov-05 21:44 
QuestionDetecting a scroll bar being enabled in a listview Pin
Dan Neely8-Nov-05 5:51
Dan Neely8-Nov-05 5:51 
QuestionHelp me with TABCONTROL Pin
kyeran8-Nov-05 5:42
kyeran8-Nov-05 5:42 
AnswerRe: Help me with TABCONTROL Pin
g00fyman8-Nov-05 13:15
g00fyman8-Nov-05 13:15 
GeneralRe: Help me with TABCONTROL Pin
kyeran9-Nov-05 1:46
kyeran9-Nov-05 1:46 
GeneralRe: Help me with TABCONTROL Pin
g00fyman9-Nov-05 2:20
g00fyman9-Nov-05 2:20 
Questionclosing event on mdi form c# Pin
fady_sayegh8-Nov-05 4:34
fady_sayegh8-Nov-05 4:34 
AnswerRe: closing event on mdi form c# Pin
MoustafaS8-Nov-05 13:32
MoustafaS8-Nov-05 13:32 
Questionembedded clr - calling static methods Pin
dirkhelmet!@yahoo.com8-Nov-05 3:42
dirkhelmet!@yahoo.com8-Nov-05 3:42 
AnswerRe: embedded clr - calling static methods Pin
Andy Moore8-Nov-05 5:25
Andy Moore8-Nov-05 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.