TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chetan Allipur
NA
541
166.9k
How to use the Dispatcher in windows form Application.
Jun 9 2017 3:21 AM
How to use the Dispatcher in windows form Application.
I am getting error on Dispatcher Keyword.
here is my code.
private void btnOk_Click(object sender, EventArgs e)
{
Dispatcher.BeginInvoke(new Action(OpenDocument));
OpenNewFile opn = new OpenNewFile();
opn.Hide();
}
public void OpenDocument()
{
if (cbRegion.SelectedIndex >= 0 && cbPaperSize.SelectedIndex >= 0 && cbFont.SelectedIndex >= 0 && cbTemplateSection.SelectedIndex >= 0 && cbTemplateDocument.SelectedIndex >= 0)
{
try
{
object missing = System.Reflection.Missing.Value;
if (!File.Exists(destinationPath))
{
File.Copy(sourcepath, destinationPath, true);
}
//Microsoft.Office.Interop.Word.Application ap = new Microsoft.Office.Interop.Word.Application();
//Microsoft.Office.Interop.Word.Document oWordDoc = Globals.ThisAddIn.Application.ActiveDocument;
Microsoft.Office.Interop.Word.Application ap = Globals.ThisAddIn.Application;
Microsoft.Office.Interop.Word.Document oWordDoc = ap.ActiveDocument;
oWordDoc = ap.Documents.Open(destinationPath, missing, false, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing
, missing, missing, missing);
oWordDoc = ap.ActiveDocument;
ap.Visible = true;
ap.Activate();
}
catch (Exception ex)
{
throw ex;
}
}
else
{
MessageBox.Show("Please select the value form combobox", "BOX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
Reply
Answers (
6
)
how to apply CGST,SGST,IGST Tax in Billing Format in window
Open Default browser and target an element