473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Inserting Variables in a Document

Ok.. here's my situation. I have a program that handles a database full of
people. Users of the program have the ability to send out notifications to
these people. Pretty standard notifications, the program tracks when
notifications are sent out and who sends them. Currently these
notifications are all sent via email.

Now the program users also want the ability to send these notifications via
standard snail mail. (I'll make a popup box come up "Do you want to print
this notification?") I want to allow the users the ability to modify these
notifications as well so that will not have to be done programmatically
if/when notification wording changes. The notifications need to allow for
variables to be insert into the document .. for example, the persons name,
address, salutation, etc. The document needs to have the capability to
print not only the document but a mailing envelope as well so my first
thought as to the document medium is to use Microsoft Word.

Originally my plan was to just have the program save the location (selected
by the user) of a Microsoft Word document. The Word document opens and the
user manually enters the recepient information. This, however, is an
undesirable solution. The users really want the information to be imported
programmatically, somewhat like a Word mail merge (except it only needs to
handle one user at a time). So my next thought is to create a Word document
dynamically every time a user opts for a printable document. Not sure if
this is ideal either because I'm not sure how I'll allow the users to edit
these documents seeing as how they don't exist as a document, I'd probably
save the document body information in a database and allow the users to
modify that. Anyways, just looking for some ideas here. Is there any way
to create a Word document and use variable fields (example: <<First Name>>,
<<Last Name>>, etc.), then have my program open that document and insert the
variable data? Are their any other output solutions (besides Microsoft
Word) I should be looking at?

Thanks for any suggestions,
Ryan
Jun 13 '06 #1
7 4164
Hi Ryan,

I think you may consider the VSTO which is introduced from VS.NET 2005.
We have a special BookMark control in VSTO project, we can use that as the
insert variable.
And it support DataBinding which will easierly to connect it onto database.

http://www.officezealot.com/VSTO/videos.aspx

http://blogs.msdn.com/vsto2/archive/...29/123027.aspx

http://blogs.msdn.com/pstubbs/archiv...03/225513.aspx

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 14 '06 #2
VSTO is a separate product from VS 2005 Pro correct? (so it would require
the purchase of more software)

I had another thought this morning. Maybe I'll export the data from the
notification to an Excel file. From there, the user can easily perform
their own mail merge in Word manually.

Ryan

""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:s$**************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,

I think you may consider the VSTO which is introduced from VS.NET 2005.
We have a special BookMark control in VSTO project, we can use that as the
insert variable.
And it support DataBinding which will easierly to connect it onto
database.

http://www.officezealot.com/VSTO/videos.aspx

http://blogs.msdn.com/vsto2/archive/...29/123027.aspx

http://blogs.msdn.com/pstubbs/archiv...03/225513.aspx

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 14 '06 #3
Hi Ryan,

You are correct.
The VSTO is included in the VSTS version of VS.NET 2005. Or you may buy a
Visual Studio Tools for Office System develop tools stand alone package.

Word Mail Merge is an approach as you said.

Also I think you may try to consider the Smart Document which is somewhat
complex than VSTO, but you may have a look.

Smart Documents Made Easier for .NET Developers
http://msdn.microsoft.com/library/de...us/dno2k3ta/ht
ml/odc_SmartDocsWrapper.asp

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 15 '06 #4
bob
Ryan,

I'm not quite sure what you want to do here. Maybe you don't need any
sophisticated Word programming, though. If your program already has the
list of names/addresses in its database, as well as the text of the
notices, then you could insert everything into a text file, then open
it in Notepad so the user could print it.

If the notice text is in one or more separate documents, you could put
placeholders in the text (such as ??name, ??addr1, ??city, etc.) and
your program could open the text file, put it into a string, and then
do a Replace function for each placeholder.

Of course, if you have tens or hundreds of names in the database and
users have to send the notice to many people at one time, that wold
probably best be handled by programming Word to do a mailmerge.

Good luck!

Ryan wrote:
Ok.. here's my situation. I have a program that handles a database full of
people. Users of the program have the ability to send out notifications to
these people. Pretty standard notifications, the program tracks when
notifications are sent out and who sends them. Currently these
notifications are all sent via email.

Now the program users also want the ability to send these notifications via
standard snail mail. (I'll make a popup box come up "Do you want to print
this notification?") I want to allow the users the ability to modify these
notifications as well so that will not have to be done programmatically
if/when notification wording changes. The notifications need to allow for
variables to be insert into the document .. for example, the persons name,
address, salutation, etc. The document needs to have the capability to
print not only the document but a mailing envelope as well so my first
thought as to the document medium is to use Microsoft Word.

Originally my plan was to just have the program save the location (selected
by the user) of a Microsoft Word document. The Word document opens and the
user manually enters the recepient information. This, however, is an
undesirable solution. The users really want the information to be imported
programmatically, somewhat like a Word mail merge (except it only needs to
handle one user at a time). So my next thought is to create a Word document
dynamically every time a user opts for a printable document. Not sure if
this is ideal either because I'm not sure how I'll allow the users to edit
these documents seeing as how they don't exist as a document, I'd probably
save the document body information in a database and allow the users to
modify that. Anyways, just looking for some ideas here. Is there any way
to create a Word document and use variable fields (example: <<First Name>>,
<<Last Name>>, etc.), then have my program open that document and insert the
variable data? Are their any other output solutions (besides Microsoft
Word) I should be looking at?

Thanks for any suggestions,
Ryan


Jun 15 '06 #5
bob
Peter,

I just clicked on your link to "smart documents made easier" and got a
message "Page Not Found". I might be interested in "Smart" documents so
if you have a better link I'd like to know what it is. Thanks.
"Peter Huang" [MSFT] wrote:
Hi Ryan,

You are correct.
The VSTO is included in the VSTS version of VS.NET 2005. Or you may buy a
Visual Studio Tools for Office System develop tools stand alone package.

Word Mail Merge is an approach as you said.

Also I think you may try to consider the Smart Document which is somewhat
complex than VSTO, but you may have a look.

Smart Documents Made Easier for .NET Developers
http://msdn.microsoft.com/library/de...us/dno2k3ta/ht
ml/odc_SmartDocsWrapper.asp

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Jun 15 '06 #6
His link is correct, it just didn't link it all in this message. If this
doesn't work just copy and paste the entire text.

http://msdn.microsoft.com/library/en...ocsWrapper.asp

<bo*@datasync.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
Peter,

I just clicked on your link to "smart documents made easier" and got a
message "Page Not Found". I might be interested in "Smart" documents so
if you have a better link I'd like to know what it is. Thanks.
"Peter Huang" [MSFT] wrote:
Hi Ryan,

You are correct.
The VSTO is included in the VSTS version of VS.NET 2005. Or you may buy a
Visual Studio Tools for Office System develop tools stand alone package.

Word Mail Merge is an approach as you said.

Also I think you may try to consider the Smart Document which is somewhat
complex than VSTO, but you may have a look.

Smart Documents Made Easier for .NET Developers
http://msdn.microsoft.com/library/de...us/dno2k3ta/ht
ml/odc_SmartDocsWrapper.asp

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jun 15 '06 #7
The document needs to be able to print an envelope too.. and notifications
could be sent to multiple people (I know I said before one person at a time
but I may change this). I'm really starting to lean towards the export data
to excel, allow the user to perform a mail merge idea.

<bo*@datasync.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Ryan,

I'm not quite sure what you want to do here. Maybe you don't need any
sophisticated Word programming, though. If your program already has the
list of names/addresses in its database, as well as the text of the
notices, then you could insert everything into a text file, then open
it in Notepad so the user could print it.

If the notice text is in one or more separate documents, you could put
placeholders in the text (such as ??name, ??addr1, ??city, etc.) and
your program could open the text file, put it into a string, and then
do a Replace function for each placeholder.

Of course, if you have tens or hundreds of names in the database and
users have to send the notice to many people at one time, that wold
probably best be handled by programming Word to do a mailmerge.

Good luck!

Ryan wrote:
Ok.. here's my situation. I have a program that handles a database full
of
people. Users of the program have the ability to send out notifications
to
these people. Pretty standard notifications, the program tracks when
notifications are sent out and who sends them. Currently these
notifications are all sent via email.

Now the program users also want the ability to send these notifications
via
standard snail mail. (I'll make a popup box come up "Do you want to
print
this notification?") I want to allow the users the ability to modify
these
notifications as well so that will not have to be done programmatically
if/when notification wording changes. The notifications need to allow
for
variables to be insert into the document .. for example, the persons
name,
address, salutation, etc. The document needs to have the capability to
print not only the document but a mailing envelope as well so my first
thought as to the document medium is to use Microsoft Word.

Originally my plan was to just have the program save the location
(selected
by the user) of a Microsoft Word document. The Word document opens and
the
user manually enters the recepient information. This, however, is an
undesirable solution. The users really want the information to be
imported
programmatically, somewhat like a Word mail merge (except it only needs
to
handle one user at a time). So my next thought is to create a Word
document
dynamically every time a user opts for a printable document. Not sure if
this is ideal either because I'm not sure how I'll allow the users to
edit
these documents seeing as how they don't exist as a document, I'd
probably
save the document body information in a database and allow the users to
modify that. Anyways, just looking for some ideas here. Is there any
way
to create a Word document and use variable fields (example: <<First
Name>>,
<<Last Name>>, etc.), then have my program open that document and insert
the
variable data? Are their any other output solutions (besides Microsoft
Word) I should be looking at?

Thanks for any suggestions,
Ryan

Jun 15 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Geoff | last post by:
I have been asked to add postal rates to a web page shopping cart checkout procedure. After contacting the post office I discovered that they used XML to receive postal rate requests and send back...
6
by: Raqueeb Hassan | last post by:
Hello There! Have you guys tried inserting variables in mySQL tables? Do I have to use 'quote' as we had been doing to insert strings? mysql> INSERT INTO occurrence (word_id,page_id) VALUES...
5
by: studen77 | last post by:
Thanks in advance to anyone who can help :) I'm trying to extract a specific NodeSet out of an XML file; however, I'd like to include a C# string variable as part of the XPATH statement; so far...
2
by: altergothen | last post by:
Hi there I am a newbie to ASP.Net - Please Help! I am trying to insert the values of my variables into a database. If I try the following it works perfectly: string insertQuery = "INSERT into...
4
by: Navillus | last post by:
Hi all, I have a cookie setup to store usernames and passwords for my site. Additionally, I'd like to store some variables in the cookie, and be able to extract them back out. I'm having trouble...
7
by: petermichaux | last post by:
Hi, I have tried the following based on suggestions of the best way to insert JavaScript into a page. This is instead of using eval(). Unfortunately IE says "unexpected call to property or...
1
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.