'Documents.Open' vs. 'Documents.Add' using Word VBA [closed] - ms-access

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am launching a Word document using VBA in Access which will import content from the form being filled into a template document.
I have tried to use both Documents.Open and Documents.Add, both of which work, but I'm not sure which one I should be using.
(I have previously had some intermittent issues using Documents.Open, but I do wonder if that was to do with some other errors in the code.)
Can anyone advise the best way to action this in VBA?

If your goal is to create new documents from a template (whether a doc, docx, docm, dot, dotx or dotm file), which appears to be the case, then Documents.Add is what you should be using.
Usually in such a scenario the original document (the template) should not be changed - Documents.Add ensures this. Workarounds for using Documents.Open, such as saving under a different file name, are an additional step (inefficient) and can go wrong.
An additional factor, when the template is a true template (dot, dotx, dotm) is that any new document by default retains a link to the template (is "attached" to the template). This means the document can share building blocks, Ribbon UI, keyboard shortcuts and (assumging not docx) macro code stored in the template.
On the other hand, if a new document should contain (inherit) content from the "template" such as macros, Ribbon UI or keyboard shortcuts present in the "template" Documents.Add would need to be used with document (doc, docx, docm) file as template.

Related

Do I need to modify my HTML document every time I want to add an article to my site? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I want to create a really simple blog and so far I learned HTML and CSS.
So if I want to add a new node or article, do I need to modify my HTML document and then upload it again or is there any other way?
If you're only using simple HTML
Then the css should be made in a way that would make it reusable, so that when you just add another article shouldn't affect anyhing else. The HTML however must be changed, as you'll need to add your content somehow
The thing is, no one uses plain HTML anymore. If you want everything to happen dynamically then you should use DOM manipulation frameworks. The most basic one of which is JQuery, while the most powerful ones as of now are React, Angular, and Vue
Well, of course you have to modify something and upload it again, but not necessarily the HTML code.
You could youse AJAX (Asynchronous JavaScript and XML) - which, by the way, you can also use with JSON instead of XML - then create a standard article model, get the latest article from your file with
fetch("your-file.xml-or-json-or-whatever").then(
function(response) { /* Do something with the response, see the link below for an example */ }
);
and finally turn it into a DOM element with JS.
This method is pretty inefficient, though, if you don't have a way to cut the output from your list of articles. In fact, if, say, you have one thousand articles, it's inconvenient (inconvenient to say the least) to serve them all and the just use the first ten. If you have a static server, you might want to split the content into multiple files. If, instead, you have access to PHP (or other HTML preprocessors), then you should consider cutting it dynamically. Below are some links to help you.
AJAX tutorial on W3Schools
Fetch documentation on Mozilla Developer
You could also think of using frameworks like Angular (or AngularJS) to make your website even more dynamic. However, those are better for web apps than websites, as I've heard that it's a bit harder for Google to register an Angular app.

Is it possible to render HTML in gmail [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
If I send this message
<h5>Hello</h5>
<h3 style="color:pink">GOODBYE</h3>
It appears as it is.
Is there any way to render the same message as HTML at receivers end?
update :
what i want on receivers side is :
Hello (style corresponding to the h5 tag)
GOODBYE (style corresponding to the h3 tag & in pink color)
Google does not accepts user's custom html. < > is converted as < > so it displayed in browser as < > , Thats all. you can't use your coding.
You cannot send HTML images in Google's gmail web interface; this interface converts al HTML tags to the human readable variant, so they get isplayed as-is on the other side.
Your alternative is to set up an SMTP server (they usually come with your ISP) and send e-mails from there. You can set the 'from' field yourself, so you can change that to your gmail account. The disadvantage is that your mail will likely be caught in spamfilters.
Good luck!
so it is completely possible to render HTML code inside an email. I've only tried it through the gmail client though. It is slightly "hacky" but works perfectly.
https://www.youtube.com/watch?v=MsMSqhMlfao
Look at this video, it highlights the steps in a fairly simple way, but there are some things you will have to change. Once you hit inspect on your dummy text, you can't just double click to edit the code, it gets pasted in as Weird text comments.
Instead, hit the "edit as HTML" button instead and remove the double quotes, pasting your code in directly. You'll be able to tell that you've done it right when your tags etc. display the way the rest of the code around it does. (I had locally linked images so they didn't show)
You'd have to send it from an external platform to arrive at the gmail inbox. Try something like SendBlaster (free download) or MailChimp (online interface)

Sitecore, why is so difficult? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to sitecore and my company has been using external company to manage their sitecore, which I totally understand, since it involved so much work on the development.
As a designer myself, I found extermely difficult to create a custom page unless I use what's already available. I could use simple page to insert my html codes but again, it's just way too long. In regular case, when you build a html site, you could simply create pages in dreamweaver and view it on your local computer.
I have tried to make a custom page with the presentation control, but each time I called a sub-rendering. the page is just a BLANK.
*so my 1st question will be, What's the procedure to create a custom page? *
I know sitecore suppose to be powerful and there is many api, I really would like to find out why I found it's so difficult......
my background is, designer base with knowledge of html, css, and php. I am not a developer that's for sure. :)
Thanks for taking time read my blah blah..:)
1st question will be, What's the procedure to create a custom page?
To answer your first question, there are some high levels steps you would generally take.
Create a page template that includes any fields or metadata you need to render the page
Create any layouts, sublayouts, or renderings necessary to render the custom page - this is where having access to a developer normally becomes necessary
Assign the renderings and datasources to the instance of your new template (or better yet, assign the renderings to __Standard Values item)
Publish everything out
You should reference the Self-Study to Building a Very Simple Site from Sitecore
2nd question will be, why do we need to call the developer each time when we want to have some feature inputs?
To answer your second question: To get very far with customizing Sitecore you will need to be a developer or have access to one. This can be mitigated to some extent depending on how flexible the solution is they developed. But let's be real - Sitecore is an Enterprise CMS, it's not Wordpress where you can install a theme and a few plugins.
As someone just learning, there are a number of options
Training from Sitecore - this is probably your best bet
Download and play with Launch Sitecore for sample code and examples to build a real website
Check out the Sitecore Marketplace for modules that can get things done for you
Subscribe to and read John West's blog for inside information of basically every aspect of Sitecore
3rd question is, why I can access the CSS?
This question doesn't make sense frankly, so I will assume it was meant to ask "How?" or "Where?" Without any more information about the site in question, you can normally map the URL to the location on disk. For example:
http://www.mysite.com/css/styles.css
This URL might map to c:\inetpub\wwwroot\mysite\website\css\styles.css
I do highly recommend that any code changes, including CSS, be done through your source control system and only be deployed following your standard release management.
Honestly, I don't believe you are qualified to modify and maintain the Sitecore site given your current training and experience level. The first step I recommend is getting that Sitecore developer training and any training available from your vendor on the specific implementation. Good luck!

Hiding some html block from anonymous users [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do I hide some html block from anonymous users who visit my application. I don't use any templating engine. My back end is in node.js .
What would be the best way to implement this?
if (loggedin)
<div id="logged-in">
Some menus for Loggedin User
</div>
else
<div id="anonymous">
Some menus for Anonymous user
</div>
You should use a templating engine.
Should you not want to do that, you can build a function that reads whether or not the user is in a session, then either prints/includes a dynamic version of the HTML (header, body, div or whatever you need) with the user specific data for logged in users, or prints/includes a generic version of the HTML (header, body, div or whatever you need) for logged out users
As others note, a templating engine is most likely the best choice. This is exactly the kind of problem they were designed to solve. Furthermore, introducing one now while the logic is simple will be less painful than introducing one later when an ad hoc solution becomes too cumbersome. (An ad hoc solution is probably going to be cumbersome to begin with, actually.)
However, one other potential solution would be to use 2 different HTML files and let your function choose which one to send the user based on whether they are logged in. This is only really feasible if the pages are completely different depending on the log in status. Even then, a templating engine allows for a more robust solution by including component files in the page, allowing you to share headers, footers, or any other common elements between the different pages.
If you are still against a templating engine and do not want to use different HTML files, you could basically do your own ad hoc templating. Put some kind of string to be replaced into the HTML, load the text into a string from the file, and use string.replace or something similar. A good example of string.replace is described here. If you choose to do this, be very careful that your "string to replace" does not conflict with HTML or any other languages used in the page itself.

Use own custom form with MailChimp [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I'm currently working on a "coming soon" page that has a single text field and button where a user can input his/her email address to get notified when the app launches. I've heard that mailchimp is quite a nice little tool to use that handles all the user details that gets collected (meaning I don't have to worry about any scripting and a database my side) as well as automatically emailing the user that signed up thanking them etc.
I've tried designing a form to use on my site with mailchimp but I'm just not happy with the overall look and feel of the forms. Sure I can change edit some properties like color and all that jazz, but it just doesn't fit my needs.
Is there a way that I can use my current html form that I already have, with mailchimp? Instead of using the forms that one designs on mailchimp.
Thanks in advance
You bet.
I'd check out their support article about custom hosted forms. It explains a bit about how form fields will need to look to jive with their database. You could also view-source of the mailchimp-hosted form you designed and see how the input names/types are put together there specifically for your list.
Also, paid accounts can use advanced forms mode to customize the HTML that they host for a list.
Yes, as winfred mentionned there are several ways.
If you know html, just get the code from the subscription html page (through "View Source" for example) and paste into a blank html page that you can modify before uploading to your website.
As you just need the email, this should be straight forward.
If you haven't seen it yet, this page could help:
http://kb.mailchimp.com/article/can-i-host-my-own-sign-up-forms
Good Luck!