Replacing Merge Fields With Our Values In Code?

Jun 29, 2011

I have this Text: Hello <<FirstName>> <<LastName>> in which the <> and <> are merge fields in a document, and I have a list of customers in an array which I want to allocate them to these fields. How do I do that?

View 2 Replies


ADVERTISEMENT

C# - MS Word Office Automation - Filling Text Form Fields And Check Box Form Fields And Mail Merge

Sep 3, 2009

experience on how to create an engine using C# (VB.NET is okay too) that is generic enough to handle most cases of MS Word text fields I need to fill with data I'm getting from a database? In short, I'm about to embark on this little Office automation excursion and I'm hoping a little bit of feedback here.

View 2 Replies

.net - Copy Merge Fields From One Word Document To Another

Aug 21, 2009

I'm editing a vb.net app for a mate and part of the requirements are to copy merge fields from one word document to another. I can copy them across using document.content.text but they come out as text (should've figured this i guess). I think i've got them selected by:

[Code]...

View 1 Replies

VS 2008 Export Fields To Word Mail Merge?

Feb 11, 2010

I have 5 RichTextbox's on my Form. I would like to export the content to either a Word Document or a Mail Merge Word document

View 1 Replies

Word Template - Print The Document (Letter) With All The Merge Fields Filled

Jun 6, 2011

I have a program in which I am trying to do the mail merge with the word template that I already have.

I have already setup the datasource for the word template in the word itself and it is pointing to my Employee Table which has all the information for the employee. I have also inserted the merge fields in the document where ever I need them. Now I want to print the document (Letter) with all the merge fields filled in from my application but for only employee whose Name or Number I sent from my program not all the employees I have in the datasource.

Now if I have to do it in Word, we have an option called Find Recipient in Mailings -> Preview Results in which I can set the Name or Number of the employee to get all his information to do the merge but how can I do the same thing from my program.

I can send all the fields values from my code like in the code below but I want to use my datasource to provide values. I have employee's Number I want to provide to the template to find the employee - so all the values are filled based on the employee's Number.

View 2 Replies

Moving From Web.Mail To Net.Mail, Replacing MailMessage.Fields?

Jan 31, 2011

I'm trying to update some older software which uses the now-declared-obsolete System.Web.Mail classes.Unfortunately, I don't really know a heck of a lot about email, so I'm looking for advice.

Here is the fragment of code I'm looking at revising:

[Code]...

From what I can tell, this should be configuring some kind of sending option. I can kind of work out what's going on, but I don't know how I should go about re-implementing it.It's looking like the place to be putting this stuff is now in the System.Net.Mail.SmtpClient.Credentials class, but the information in there doesn't seem to bear any resemblance to what I have here.I'm almost certain I'm making some obvious error, here, but I can't see it. Can someone tell me what I should be doing?

View 4 Replies

Streamwriter - Replacing Specific Values In A Large Text File

Jun 4, 2011

I have some large csv files (1.5gb each) where I need to replace specific values. The method I'm currently using is terribly slow and I'm fairly certain that there should be a way to speed this up but I'm just not experienced enough to know what I should be doing. This is my first post and I tried searching through to find something relevant but didn't come across anything.

My other thought would be to break the file into chunks so that I can read the entire thing into memory, do all of the replacements there and then output to a consolidated file. I tried this but the way I did it actually ended up seeming slower than my current method.

Sub Main()
Dim fName As String = "2009.csv"
Dim wrtFile As String = "2009.1.csv"

[Code]....

View 1 Replies

.net - Merge WPF App With C# And Code?

Oct 27, 2011

I have an application, written in C#, which needs some functionality from VB.NET (better said, something valid in CIL but not provided in C#).
So I have an executable and a library file.

Problem:
It has to be published in one file and may not be split to different assemblies!

But:
It's a WPF application, ILMerge will not work.

What could I do?Is it possible to generate (performant) IL on the fly?

View 3 Replies

Replacing Legacy BASIC Code With VBA?

Sep 7, 2009

I have an old application in BASIC. It still runs under Windows ME. It no longer works under XP, so I was looking at recoding the applciation. I started coding it in VBA, which I have used for Excel macros for years.

We are looking at getting a new computer for kids to use for schoolwork, etc. I also want the kids to learn programming and recoding my old BASIC application is a good place to start. A new computer we were considering has MS Works, but I suspect I will need MS Office (at least Excel) to get VBA. There are multiple versions of Office 2007 (Home & School, Small Business, Pro), so I looked into the Microsoft website to see if I could find out what version of Office I need to get to have VBA. What I found is that VBA seems to be going away in favor of VSTA and VSTO.

Is VBA truely going away? Or is it still going to be a part of Excel for wrting macros? If VBA is part of Excel, is it available in all versions of Office? If VBA is going away, what is recommended for recoding my old BASIC application?

The application involves display of a screen full of data with color coding and has several actions for updating those data.It does not involve any graphics or animation. In the old BASIC application all the system data and runtime data are in program variables.

The actions to be performed are selected by number from menus.In creating the application in VBA, I envisioned primary data display on a main form, which would also have buttons to invoke dialog panels to perform the various updating actions.I have the system data that are not changed when the application is run in one Excel worksheet and the runtime data on another worksheet.

View 2 Replies

Combine Source Code Of .dll And Exe To Merge?

Oct 12, 2010

I've recently been trying to merge an exe and a dll, which I asked about in this thread. I've spoken to the developer of the dll I'm using however, and I've managed to obtain his permission to combine his dll source code into my application directly. So basically my question is, how can I do that? I have the dll source code project, which is a C# project, and MY application, which is a WPF VB.Net project. How can I combine the projects so that it will function the same as if I had the dll as just another referenced file?

View 1 Replies

.net Automated Word/excel Mail-merge Code Snippet?

Sep 10, 2011

I've got a Word doc with insertion fields already created and an Excel spreadsheet with the data for a mail-merge.Does anyone have a code snippet for merging the two into a Word form-letter in VB.net?

View 2 Replies

Inserting Null Values Into Date Fields?

Apr 20, 2012

I have a FormView where I pull data from one table (MS Access), and then insert it (plus more data) into another table. I'm having issues with the dates.The first table has two date fields: date_submitted and date_updated. In some records, date_updated is blank. This causes me to get a data mismatch error when attempting to insert into the second table.It might be because I'm databinding the date_updated field from the first table into a HiddenField on the FormView. It then takes the value from the HiddenField and attempts to insert it into the second table:

Dim hfDateRequestUpdated As HiddenField = FormView1.FindControl("hfDateRequestUpdated")
myDateRequestUpdated = hfDateRequestUpdated.Value
'... It then attempts to insert myDateRequestUpdated into the database.

[code].....

View 2 Replies

MaskedTextbox - How To Pass Values Of Fields To Database

Apr 24, 2010

I am new using Vb. I did create an app that accept general customers info, and save it into a database using the bindingsource component(I don't know how to do it with SQL from VB). Everything was fine, but adding a couple of maskedtextbox has become difficult. I don't know how to pass the value of this fields to the database. I used the following code:
phonetextbox.text = maskedtextbox.text
Leaving the original fields in the form, I see the values on them, but they never goes to the database. Is this just possible using sql command from VB?

View 1 Replies

Number Of Query Values And Destination Fields Are Not Same

May 9, 2011

I am getting the above error in my code. I've searched the net (on this site and others) for a solution to this problem and it seems that its either something to do with a field name being a reserved name ie. Date, Time etc.... or its missing (') or (") in the SQL command. ive tried both these solutions to no avail.

Dim objDataAdapter As New OleDbDataAdapter
Dim objDataSet As New DataSet
Dim objDataReader As OleDbDataReader
Dim i As Integer
Dim SQLstr As String
[Code] .....

View 2 Replies

Why Are Number Of Query Values And Destination Fields Not The Same

Feb 6, 2011

here is my code. dont seem to know whats the problem. i have 12 data fields in access excluding the ID field.

Dim strCon As String = "Provider=Microsoft.jet.oledb.4.0;data source=C:UsersdexterDocumentsdesktopcsci14databaseMuseum-final.mdb"
Dim dSet As New DataSet

[Code].....

View 3 Replies

Asp.net - Disabled And Uncheck The Checkbox Values From Database Fields?

Dec 11, 2010

how to disabled and uncheck the checkbox values from database fields.. if i have entry in my database records as :

[Code]...

I want on page load event the default date for todays is 11-Dec-2010 then checkbox1, checkbox2, checkbox3, checkbox4 will be disabled and unchecked state for 11-Dec-2010 as you see on the above database structure the seats for 11-Dec-2010 is 1,2,3,4 so the chekbox1, checkbox2, checkbox3, checkbox4 will be disabled... I wanna this code snippet in VB.NET

View 1 Replies

Error - Number Of Query Values And Destination Fields Are Not The Same

Dec 12, 2011

i am making a simple testing application within visual studio 2010, thought im gonna be direct. in ms.acces i made a database with a few tables, this one is about the table : leden. the error indicates that i simply do not have enough values to insert into the table and i think it has to do with the ID(autincrement in acces)

[Code]...

View 7 Replies

Error Number Of Query Values And Destination Fields Are Not The Same?

Jul 29, 2011

Private Sub ButtonSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
If frUpdate = False Then

[code].....

View 5 Replies

Getting Field Values From A List Into Fields In A Structure Or Class?

Mar 21, 2012

I have a class (using a class rather than a structure only because I can set a default field value for the fields I declare in the class) and I'm using a web service that returns information (demographic information) in JSON. I am using LINQ to get the values of each "entry" from the returned list and in that, I have to parse through and pull out the actual data that I want.Here's how I have it doing right now (just a start, there are 44 of them total, thus my question which will follow the code):

Dim returnedStats = From ljo As Linq.JObject In returnedObject.SelectToken("results")
'
'
For Each stat As Linq.JObject In returnedStats

[code]....

View 2 Replies

Setting Values For Invisible Fields/Properties In DetailsView?

Mar 16, 2011

I have a DetailsView which has two fields - one that is visible, one that is not. The first the user fills out, the second I want to auto-populate. Unfortunately, I haven't been able to find a way to set the value in this second invisible field. I've tried adding code like this to the Page_Load:

If Not IsPostBack Then
DetailsView1.DefaultMode = DetailsViewMode.Insert
Dim txt1 As TextBox = DirectCast(DetailsView1.FindControl("Type"), TextBox)
txt1.Text = "administrator"
End If

But this returns an error of "Object reference not set to an instance of an object." Any ideas on how to accomplish this - either using the method above or another method?The hoped for end result is that when a new record is inserted via the DetailsView that this record will include the username (entered by the user) as well as the "type" of "administrator"

View 2 Replies

Update Values In A Dictionary With New Fields Obtained From Wmi Query?

Jan 20, 2012

I still can't assign the process the username of the session id that is associated with it.[code]...

View 1 Replies

VS 2008 - Foreach Values - Blank Out The First 4 Fields Returned ?

Jan 1, 2010

When i parse some html and get the fields i need using regex, the first 4 fields returned are fields i don't need, so essentially i need all fields returned after the 4th one.

vb.net '// First piece of data we want...
Dim stringID As New Regex("(?<=><optionvalue="").*?(?="">)", _
RegexOptions.IgnoreCase Or RegexOptions.Singleline)
Dim stringsMatched As MatchCollection = stringID.Matches(stringClean)

[CODE]...

Is there a way i can blank out the first 4 fields returned?

View 2 Replies

Pass Multiple Values To Single Fields In Crystal Report?

Jun 10, 2011

I have tested my code in order to pass single value to single parameter field in crystal report from VB.NET Form, it is ok but the problem is that I want to pass multiple values to only one parameter field called "Product Name" and it displays only one last record.

I want to display like this

Receipt : 0001 Product Name
pencil
pen
stamp
book

[Code]....

I already set parameter field "productname" for allowing to multiple values, but it is still the same.

View 2 Replies

Passing Values From Gridview Hyperlink Fields To Next Page Labels?

Apr 5, 2012

I'm trying to use hyperlink fields in my gridview to pass certain values into another page using querystrings. On the next page I've put 'labels' that should be populated with data from the gridview, however nothing happens. This is my gridview code:

Code:
"<asp:GridView ID="GridViewGuitars" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSourceGuitars" DataKeyNames="ProductID" BorderColor="White">
<Columns>

[Code].....

View 3 Replies

When Try To Enter Code Intelisence Not Active And Fields Not Available

Jan 30, 2010

Currently working in VB 2008 Pro. I have a web site connected to an SQLExpress database. I have a databound form that needs to calculate some basic math. I have a button Click event in code behind file, when I try to enter code intelisence not active and fields not available. I tried to work the math in the select query SqlDataSource, but form would not update only insert.

View 1 Replies

Fill Fields In A Structure In A Single Line Of Code?

Sep 21, 2009

Just suppose that I define a structure, and an array such as

Structure Person
Dim First_Name as String
Dim Last_Name as String

[code]....

Can I fill in my list of people using a single line of code for each record? Something like this, it doesn't work, but this shows the sort of thing I mean.

My_List(0) = {'John', 'Smith', 24, '555-1234'}
My_List(1) = {'George', 'Jones', 31, '555-8123'}
My_List(2) = {'Tom', 'Green', 40, '555-3434'}

It's easy enough to fill it in line by line. I could do that without problem. But I want to be able to look at the code and see the contents of each line. Doing it as above would make it easier to read.I could make it a multidimensional array of strings, rather than a structure.If it makes any difference I'm using Visual Basic 2005 Express Edition.

View 8 Replies

VS 2010 Consolidating Code - Use A Single Datasource (containing All 80 Fields)

Aug 1, 2011

I am converting a VB 6 app to VB.Net. In the vb 6 version I have a table that contains roughly 80 fields. Over that table the users currently have a single form which gives 12 diferent views. Each view is placed on a different tab, which, although giving a distinct set of fields per tab, also leads to a ton of duplicated code. Changing the underlying table is not an option.

What I would like to do is to use a single datasource (containing all 80 fields), a single datagridview on the form, and have a combobox act as the filter choice for the differing views. Does my solution seem like the right way to handle this? If so, I'm not sure I know which controls would best be used.

View 3 Replies

Dataset Not Updating When Bound Text Fields Are Changed In Code?

Sep 1, 2009

I am having issues understanding why it is that a text box that has been bound to a dataset correctly updates that dataset when the text in the box is manually changed i.e. by changing it using the keyboard but the dataset does not recognise the change when I change it in code.Am I missing something obvious? The text is changed in code when the user clicks on a command button that copies the text from another textbox on the form to this textbox.

[Code]...

As i mentioned, manually it works fine but when I use the comman button to change the text it does not recognise that any changes have occured.

View 4 Replies

Creating VB Code To Increment The Number Of Fields In An SQL Create Table Statement

May 8, 2012

I have an SQL statement which i need to code in vb:

CODE:

Notice the fields prodno1 and prodno2 in the table structure.. this is part of a number of sql statements i need to run and put inside a loop. my problem is i want to automatically use this same code such that on the next loop, this sql statement is going to be:

CODE:

Note that in this "2nd loop"

- the table name is now r3 from r2 in the first SQL statement
- there are now prodno1, prodno2 and prodno3 instead of just prodno1 and prodno2
- in the WHERE clause, the p.prodNo becomes p.prodNo2

And so on and so forth.. so for the 3rd loop

- there's going to be r4
- there's going to be prodno4
- in the WHERE clause i will use p.prodNo3

View 3 Replies

Private Fields Flagged As WithEvents Are Taken By Code First To Build An Automatic Foreign?

Jan 22, 2012

a simple question. Given the following code:

Public Class MyClass
Private WithEvents pPerClass As PersistableClass
Public Overridable Property PerClass() As PersistableClass
Get
Return pPerClass

[Code]...

the first being a duplication of the second key, strangely obtained from a private field.

If you remove the WithEvents keyword, the pPerClass_PersistableClassID key is not created.

I am new to EF but it seems to me a strange behaviour.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved