16,012,316 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Barry_Sharp (Top 6 by date)
Barry_Sharp
15-Jan-18 4:59am
View
In case you're interested, I've used this
c# class for imap client
in the past, like this:
Using imap As New ImapClient("imap.gmail.com")
imap.Authenticate("<username>", "<password>")
For Each folderInfo In imap.ListFolders()
Dim folder = folderInfo.Name
imap.SelectFolder(folder, True)
For Each messageInfo In imap.ListMessages()
Dim message = imap.GetMessage(messageInfo.Uid)
' TODO ...
Next
Next
End Using
Last, you can also check this example for
receiving or retrieving emails in c# and vb.net
.
Barry_Sharp
15-Jan-18 4:45am
View
Just as an FYI, you could consider avoiding the hassle that comes with COM interface by using a pure C# solution. For example, you may want to check out this
PowerPoint library in C# for presentations
. For instance, here is how you would create a new presentation with it:
PresentationDocument presentation = new PresentationDocument();
presentation.Save("empty-presentation.pptx");
Barry_Sharp
15-Jan-18 4:34am
View
First, you cannot suppress that MS Word message. When you set "UpdateFieldsOnOpen" it will mark the element with an "isDirty" flag which will result in MS Word asking for a confirmation before updating it.
Second, if you plan to use the below suggested macro approach, I think it would be far easier for you to have that macro already available in your template document, rather then trying to create it with OpenXML SDK.
If you must use OpenXML SDK for this then you'll need to:
- Change the format from DOCX to DOCM, with "WordprocessingDocument.ChangeDocumentType".
- Create and add "VbaProjectPart", with "WordprocessingDocument.AddNewPart".
- Create and add "VbaDataPart"...
This last requirement is a tricky part, you see inside the DOCM file macros are stored in "vbaproject.bin". That is a binary file which is completaly different to OOXML format, see
Office VBA File Format Structure
.
Last, as an alternative you may want to check out this
Word processing library for .NET Framework
. It can enable you to easily manipulate with
Word files in C#
. For example, see how to
create and update Word TOC in C# and VB.NET
.
Barry_Sharp
15-Jan-18 4:14am
View
See how to
read excel file in c#
, the used Load method can work with both physical file (when providing an Excel file's path) or with an in-memory file (when providing an Excel file's stream).
Barry_Sharp
24-Oct-17 2:19am
View
You mentioned that you can read the data, how exactly are you doing that, what approach are you using?
I'm certain that whatever approach you're using to
read excel files in C#
can also retrieve all sheet names.
Barry_Sharp
24-Oct-17 2:16am
View
Can you upload somewhere an example of the XLS file that you have and the example of MPL file that you would like to get?
I'll investigate those files and a small sample code for you.
Show More